(一)有关配置信息的Git命令
1.查看本地设置的属性 git config user.name/user.email
2.显示本地配置信息 git config -l(小写的L)
3.修改当前全局的用户名 git config user.name <username>
4.修改当前全局的邮箱 git config user.email <useremail>
(二)修改和提交
1.把文件添加到仓库(跟踪指定文件) git add <file>
2.把全部修改添加到仓库 git add .
3.把文件提交到仓库,一次可以提交多个文件(带有提交说明,有些git版本不支持utf-8) git commit -m "commit messages"
4.修改文件名 git mv <oldfilename> <newfilename>
5.删除文件 git rm <file>
6.停止使用git跟踪文件但不删除文件 git rm --cached <file>
7.查看状态,有没有修改没有提交 git status
8.查看表更内容 git diff
(三)查看提交历史
1.查看提交历史(从最近到最远) git log
2.查看指定文件的提交历史 git log -p <file>
3.查看操作记录(从最近到最远) git reflog
仅作为学习参考(*^__^*) 嘻嘻……
原文:http://www.cnblogs.com/qinglianjianxian/p/6237348.html