首页 > 其他 > 详细

git log的个性化设置

时间:2019-05-30 20:16:40      阅读:103      评论:0      收藏:0      [点我收藏+]
--date=(relative|local|default|iso|rfc|short|raw)
  Only takes effect for dates shown in human-readable format,
  such as when using "--pretty".  log.date config variable
  sets a default value for log command’s --date option.
--date=relative shows dates relative to the current time, e.g. "2 hours ago".
--date=local shows timestamps in user’s local timezone.
--date=iso (or --date=iso8601) shows timestamps in ISO 8601 format.
--date=rfc (or --date=rfc2822) shows timestamps in RFC 2822 format,
  often found in E-mail messages.
--date=short shows only date but not time, in YYYY-MM-DD format.
--date=raw shows the date in the internal raw git format %s %z format.
--date=default shows timestamps in the original timezone
  (either committer’s or author’s).

 

.gitconfig中天上下面这样, 就很好了

git config --global pretty=xxxxx

git config --global log.date=xxxxx

[format]
    pretty = "  %Cred%h %Cgreen(%ad) %C(bold blue)<%an> %Creset%d  %s "
[log]
    date = iso8601

 

达到的效果就是:

git log --pretty=format:‘  %Cred%h %Cgreen(%ad) %C(bold blue)<%an> %Creset%d  %s ‘ --date=format:‘%Y-%m-%d %H:%M:%S‘ -n 100

的效果.

设置了全局之后, git log就按照上面的好看的格式出来了.

 

git log的个性化设置

原文:https://www.cnblogs.com/tekikesyo/p/10951521.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!