Git操作大全[实际用到的都放在这里总结]


1.如何合并远程两个分支feature-rebuild和develop?
g fetch
g checkout -b develop origin/develop
g merge feature-rebuild
g push origin develop

2.暂存工作区内容,以及恢复?

g stash

g stash list

g stash pop --index stash@{0}

 3.撤销本次修改?

git checkout *.php
git checkout .

git revert HEAD    撤销前一次 commit

4.分支重命名与删除?

  

 git branch -m oldbranchname newbranchname

 git branch -m old-local-branch-name new-local-branch-name

 git push origin  :old-local-branch-name

 git push origin  new-local-branch-name: new-local-branch-name

  

  

posted @ 2017-03-18 14:32  purelightme  阅读(152)  评论(0编辑  收藏  举报