git不常用操作汇总

2017-08-15  本文已影响11人  rockops

记录git不怎么常用,但偶尔会很有用的操作

1, 撤销本地上一次的commit

git reset HEAD~

2, 撤销远端的上一次push

git reset --hard <commit-hash>
git push -f origin master

3, merge另一个分支的某次commit
git cherry-pick $commit_hash

4, 查看某次commit的详情
git show $commit_hash

5, 查看远端分支
git remote -v

上一篇下一篇

猜你喜欢

热点阅读