Git如何保存预设的git log --format [英] Git how to save a preset git log --format
问题描述
git log 我很喜欢简短的git log格式,在这里我可以看到作者,日期和更改描述。 --pretty = format:%h%x09%an%x09%ad%x09%s
哪些输出:
fbc3503 mads Thu Dec 4 07:43:27 2008 +0000显示mobile if phone is null ...
ec36490 jesper Wed Nov 26 05:41:37 2008 +0000 [942]之后清理:使用timezon
ae62afd tobias星期二11月25日21:42:55 2008 +0000固定#67加入时区supp
164be7e mads星期二11月25日19:56:43 2008+0000固定测试,和一个'无休止的appoi
(从stackoverflow问题 考虑git log手册页提到: 漂亮地打印提交日志的内容在一个给定的格式,其中可以是在线,短,中,全,完整,电子邮件,原始和格式之一:。 或 I really like the short git log format where I can see author, date and change description like this: Which outputs: (from stackoverflow question "link text") Now, the question is, how do I save this as a new format on my machine so I only have to write something like, for instance:
Considering the git log manual page mentions:
Pretty-print the contents of the commit logs in a given format, where can be one of oneline, short, medium, full, fuller, email, raw and format:. When omitted, the format defaults to medium. the or
这篇关于Git如何保存预设的git log --format的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
git log --format = jespers_favourite
$ p $ - pretty [=< format>]
--format [= < format>]
< format>
只能有预定义的值。
这只能让你有可能定义一个别名 作为该命令的快捷方式。
[别名]
jespers_favourite = log --pretty = format:%h%x09%an%x09% ad%x09%s
<$ $ b $ [别名]
compactlog = log --pretty = format:%h%x09%an%x09%ad%x09%s
git log --pretty=format:"%h%x09%an%x09%ad%x09%s"
fbc3503 mads Thu Dec 4 07:43:27 2008 +0000 show mobile if phone is null...
ec36490 jesper Wed Nov 26 05:41:37 2008 +0000 Cleanup after [942]: Using timezon
ae62afd tobias Tue Nov 25 21:42:55 2008 +0000 Fixed #67 by adding time zone supp
164be7e mads Tue Nov 25 19:56:43 2008 +0000 fixed tests, and a 'unending appoi
git log --format=jespers_favourite
--pretty[=<format>]
--format[=<format>]
<format>
can only have predefined values.
That only leaves you the possibility to define an alias as a shortcut for that command. [alias]
jespers_favourite = log --pretty=format:"%h%x09%an%x09%ad%x09%s"
[alias]
compactlog = log --pretty=format:"%h%x09%an%x09%ad%x09%s"