织梦CMS - 轻松建站从此开始!

罗索

Pretty git Log

落鹤生 发布于 2012-06-26 09:23 点击:次 
unless you're a contributor of the git project and have written at least part of original code and/or documentation that does this trick... Then you probably stole the idea. ;) (IMHO)
TAG:

SO you dislike git log output in console like me and do not use it... Because it looks like so:

How about this one?

It's quite easy...

Just type:

git log --graph
 --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
 --abbrev-commit --

It may be hard to enter such an easy command every time. Let's make an alias instead... Copypaste this to your terminal:

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"

And use simple command to see this pretty log instead:

git lg

Now in case you want to see lines that changed use: 

git lg -p

In order for this command to work remove 

the -- from the end of the alias.

May the code be with you!

NOTE: this article is a rewritten copy of 

http://coderwall.com/p/euwpig?i=3&p=1&t=git
and have been put here only in purpose of note to myself.  However you may use for your own needs...

UPD2: And unless you're a contributor of the git project and have written at least part of original code and/or documentation that does this trick... Then you probably stole the idea. ;) (IMHO)

(garmoncheg)
本站文章除注明转载外,均为本站原创或编译欢迎任何形式的转载,但请务必注明出处,尊重他人劳动,同学习共成长。转载请注明:文章转载自:罗索实验室 [http://www.rosoo.net/a/201206/16115.html]
本文出处:blogspot.se 作者:garmoncheg 原文
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片
栏目列表
将本文分享到微信
织梦二维码生成器
推荐内容