Skip to content
LYF edited this page Apr 26, 2016 · 1 revision
  1. git log --pretty=short

以简洁模式列出每次提交(log),在一屏能列出来更多有用的信息,看起来更干净

  1. git log --graph

以图表形式列出每次提交(log)

  1. git reflog

列出详细操作log和commit hashcode

  1. git branch

查看分支信息。将会列出所有分支,当前分支前面用 * 号标识

  1. git checkout XXX

切换到 XXX 分支

  1. git checkout -

切换到上一次所在的分支。跟linux中的 cd - 一样

  1. git checkout -b YYY

创建分支YYY,并切换之。相当 命令4 和 命令5 的结合

  1. merge --no-ff YYY

把分支YYY合并到master分支上

  1. git commit -am 'comment'

相当于 git add . 和 git commit -m 'comment'。这个是我一直在寻找的简洁命令。不用每次都执行两条命令了。

Clone this wiki locally