Shawson Lim

搬运工. 砌匠. 包工头.

Category
 » mysql
 » golang
 » linux
 » git
 » php
 » front
 » staticstics
 » default
 » tools

[Git] 分支命令

31 May 2016 » git
  • 查看分支 git branch

  • 创建分支 git branch <name>

  • 切换分支 git checkout <name>

  • 创建+切换分支 git checkout -b <name>

  • 合并某分支到当前分支 git merge <name>

  • 删除分支 git branch -d <name>

  • 查看日志 用git log –graph命令可以看到分支合并图(git log --graph --pretty=oneline --abbrev-commit

合并分支时,加上--no-ff参数就可以用普通模式合并,合并后的历史有分支,能看出来曾经做过合并,而fast forward合并就看不出来曾经做过合并

Related Posts

© Shawson Lim - https://github.com/linsir123 - Powered by Jekyll.