关于git: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的合并我个别都会应用扁平化合并进行合并

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理