Skip to main content

目录

  • Git 常用命令
  • git pull 有两种模式

Git 常用的是以下几个命令:

  • git init
  • git status[ˈsteɪtəs]
  • git add
  • git commit
  • git clone
  • git push
  • git pull:下载远程代码并合并
  • git branch:创建分支命令
  • git checkout:切换分支命令

git pull 有两种模式

git merge[mɜːrdʒ]和 git rebase[ riːbeɪs]

  • 相同点: 都是 Git 用来合并分支代码基本命令
  • 不相同点:
    • git merge 是分支代码合并后不破坏原分支的代码提交记录,但是会产生额外的提交记录
    • git rebase 是无须新增提交记录到目标分支,rebase 后可以将对象分支的提交记录续上目标分支上,形成线性提交历史记录

参考文章:https://joyohub.com/2020/04/06/git-rebase/