2016-11-15 16 views
1

我想要一个漂亮的外观git日志。
我目前使用git log --branches --remotes --tags --graph --decorate --oneline,这已经很不错了。是否可以根据一些内置选项进一步自定义git日志的格式?

但它不显示提交者名称和日期,我想要做的是基于上述内置选项做一些进一步的定制。

可能吗?

+0

的可能的复制[漂亮的混帐分支图](http://stackoverflow.com/questions/1057564/pretty-git-branch-graphs) –

回答

0

你们第一个我建议使用--all而不是--branches --remotes --tags来使你的命令行更紧凑。 此外,您可以在.gitconfig文件中添加您的别名,而不是有很长的命令行。

我使用以下两种aliasesL

[alias] 
    superlog = log --graph --all --decorate --pretty=oneline 
    superlogextended = log --graph --all --decorate 

superlogextended看起来像你所要求的。 当您在~/.gitconfig添加别名只是用这样的:

git superlog 
git superlogextended 
+1

值得一提的是,“--all”与(--branches --remotes --tags)不同: - 前者表示*所有引用*,后者三者一起使用意味着所有分支,远程跟踪分支和标签*。区别在于*所有引用*如果存在,则将'refs/notes/*'和'refs/stash'加上,如果存在任何这样的东西,则加上'refs /'中的任何其他内容。 (除此之外,我自己使用'--all'。) – torek

相关问题