🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
![01.png](http://upload-images.jianshu.io/upload_images/3701654-5e522b8fd534bc56.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ### 1.点击Git Bash ![02.png](http://upload-images.jianshu.io/upload_images/3701654-8d21437489651cbf.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ### 2.配置全局信息在命令行中输入 ~~~ git config --global user.name chengbenchao git config --global user.email 395775347@qq.com ~~~ ![03.png](http://upload-images.jianshu.io/upload_images/3701654-748f493df80cfe7d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ### 3.列出[全局配置]()的相关相信 ~~~ git config --list --global ~~~ ![04.png](http://upload-images.jianshu.io/upload_images/3701654-ef36d319edccbf51.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ### 4.增加用户名 ~~~~ git config --global --add user.name jiangwei ~~~~ ![05.png](http://upload-images.jianshu.io/upload_images/3701654-75c3bc19bc178c1d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ### 5.删除用户名[jiangwei]() ~~~ git config --global --unset user.name jiangwei ~~~ ![06.png](http://upload-images.jianshu.io/upload_images/3701654-9a2fc733db36a803.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ### 6.查询用户名 ~~~ git config --get user.name ~~~ ![07.png](http://upload-images.jianshu.io/upload_images/3701654-49547fce7b96ec7a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ### 7.修改用户为[chengchao]() ~~~ git config --global user.name chengchao ~~~ ![08.png](http://upload-images.jianshu.io/upload_images/3701654-1a8c1eebce2b1d78.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ### 8.创建文件夹[learnGit]() ! ~~~ mkdir learnGit //显示当前目录 pwd ~~~ ![09.png](http://upload-images.jianshu.io/upload_images/3701654-e7f8ae612c6848bc.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ### 9.git init将文件夹变为git仓库 ~~~ git init ~~~ ![10.png](http://upload-images.jianshu.io/upload_images/3701654-41e556b66f01615b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ### 10.在learnGit文件夹下新建一个readme.txt的文档,之后[git add]()添加到仓库,[git commit]()提交到仓库 ~~~ git add readme.txt git commit -m"firstCommit" ~~~ ![11.png](http://upload-images.jianshu.io/upload_images/3701654-182aab09dcff49c3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ### 11.修改[readme.txt]()这个文件,之后再命令行中输入[git status]()可以看到仓库当前的状态 ~~~ //可以看到仓库的当前状态 git status ~~~ ![12.png](http://upload-images.jianshu.io/upload_images/3701654-eec6aab784e989d3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ### 12.[git diff]()可以看readme.txt哪里被修改了 ~~~ git diff ~~~ ### 13.文件重新命名 ~~~ git mv readme.md read ~~~