>软件安装
###1.安装GIT
![软件.png](https://upload-images.jianshu.io/upload_images/13085823-74bd24a9fab8fe20.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
- #####安装成功
![成功.png](https://upload-images.jianshu.io/upload_images/13085823-7b22d8eaaacf8a32.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
###1.2 安装TortoiseGit
######1.用于显示文件的状态
######2.用邮箱注册
>注册码云建项目
- ##创建项目test
>git的配置
###2.1 https的配置
- ######1 复制地址
![https.png](https://upload-images.jianshu.io/upload_images/13085823-3d15d86d0c4ee6b5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
- ######2 打开磁盘 如:D盘
![1.png](https://upload-images.jianshu.io/upload_images/13085823-f74dc739c7542979.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
- ######3 复制项目到本地
~~~
student@STUDENT-PC020 MINGW32 /d
$ git clone https://gitee.com/dingmeili/test.git <--复制命令-->
fatal: destination path 'test' already exists and is not an empty directory.
~~~
###2.2 ssh的配置
- 配置公钥
![2.png](https://upload-images.jianshu.io/upload_images/13085823-797bddcf5d11919c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![3.png](https://upload-images.jianshu.io/upload_images/13085823-cfb6926ece329d5b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![4f.png](https://upload-images.jianshu.io/upload_images/13085823-dcb8f558eae942ae.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
- ######将id-rsa.pub的内容复制到钥匙里面
- ######其他如https
###2.3 https和ssh的区别
-######https上传要密码,ssh可以免密
###2.4 git的三个区及项目上传
![5.png](https://upload-images.jianshu.io/upload_images/13085823-dc6e94c1119c321b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
~~~
git add . //添加到暂存区
git commit -m"xx" //添加到版本库xx为注释
git push //推送到远程
~~~
>vscode的环境配置
* ###3.1插件安装
```
Open in browser
```
* ###3.2快捷的配置
######将以下内容按后面的步骤粘贴进`keybindings.json`
```
[
{ "key": "alt+/", "command": "editor.action.triggerSuggest","when": "editorTextFocus" },
{ "key": "ctrl+d", "command": "editor.action.deleteLines","when": "editorTextFocus" },
{ "key": "ctrl+alt+down","command": "editor.action.copyLinesDownAction", "when": "editorTextFocus" },
{ "key": "ctrl+alt+up", "command": "editor.action.copyLinesUpAction", "when": "editorTextFocus" },
{ "key": "shift+enter", "command": "editor.action.insertLineAfter", "when": "editorTextFocus && !editorReadonly" } ,
{"key":"ctrl+w","command": "extension.openInBrowser" , "when": "editorTextFocus" }
]
```
![6f.png](https://upload-images.jianshu.io/upload_images/13085823-8b618ff2508e106d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![7.png](https://upload-images.jianshu.io/upload_images/13085823-fca80cc27b247620.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![8.png](https://upload-images.jianshu.io/upload_images/13085823-56cc76708cc03422.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
>问题
#####1 本地文件删了,云端上没删,本地重建不能上传
~~~
git add . git commit -m"css" git push 本地云端全删了
~~~
#####2云端删了,本地没删
~~~
先备份本地文件
再git pull 让本地与云端同步
~~~
>如果本地删了,想从云端搞下来,你就直接克隆吧