git指南

本地提交:

  • git commit
  • git commit --amend 修改提交记录

分支:

  • git branch branch-name
  • git checkout -b branch-name

合并分支:

  • git merge branch-name
  • git rebase master

在提交树上移动:

  • git checkout master^
  • git branch -f master HEAD~3 将分支强制移动到HEAD倒退3步的位置

撤销变更:

  • 本地 git reset branch-name~1
  • 远程 git revert branch-name

整理提交记录:

  • git cherry-pick c2 c4
  • git rebase -i 交互方式

标签:

  • git tag tag-name branch-name

远程:

  • git clone
  • git fetch
  • git pull( git fetch;git merge origin/master)
  • git pull --rebase ( git fetch;git rebase origin/master)
  • git push ( git push source:des)

Ref:

https://www.bootcss.com/p/git-guide/
动画教程: https://learngitbranching.js.org/

posted @ 2019-12-18 10:08  youqia  阅读(95)  评论(0编辑  收藏  举报