git 进阶命令

1: 分之提交历史查看

git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'

按照git commit 提交顺序排列本地分之。可以用此命令将一些很久没有用到的分之delete掉。

2:扁平化merge

git merge --squash

其实还是挺有用的,在github,gitee等代码托管网站中对于pr的合并我一般都会使用扁平化合并进行合并

你可能感兴趣的:(git,github)