git 命令 总结

1.添加所有文件

git add .

2.添加某个文件

git add filename

3.commit 注释

git commit -m'commit 注释'

4.修改commit 注释

git commit --amend  

5.git pull

git pull origin develop --rebase 

6.git push

git push

7.git merge

git merge --no-ff origin/develop

8.查看 stash list

git stash list

9.应用 stash 并删除

git stash pop [stash@{1}]
git stash pop === git stash pop stash@{0}

10.git 撤销

撤销命令

11.commit撤销

git reset --hard commit-id  这个命令要慎用 难恢复 用下面的
git reset --soft commit-id  撤销commit 但不删代码

12.git add . 撤销

git reset [filename]
没有文件 默认撤销所有

13.可以选择提交某些行

git add -p // 可以选择提交某些行

原文地址:https://www.cnblogs.com/Running00/p/10750527.html