V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Aben
V2EX  ›  程序员

分享2个 git alias

  •  
  •   Aben · 2012-06-26 12:39:11 +08:00 · 3777 次点击
    这是一个创建于 4321 天前的主题,其中的信息可能已经有所发展或是发生改变。
    今天看到酷壳这篇文章《Git显示漂亮日志的小技巧》 http://coolshell.cn/articles/7755.html ,以及这篇 http://coderwall.com/p/euwpig 「墙」。发现比我常用的
    git log --stat 更好看,简单看了下 git log 的帮助,写了两条更符合我口味的别名。

    [alias]
    lg = log --color --graph --pretty=format:'%c(yellow)%h%creset -%cred%d%creset %s %c(bold blue)(%cn %cr)%creset'
    ll = log --color --pretty=format:'%c(yellow)%h%creset -%cred%d%creset %s %c(bold blue)(%cn %cr)%creset' --no-merges

    --no-merges是不显示merge产生的log(想要显示删除即可), --abbrev-commit 是显示简略 HASH, 等同于format 里的 %h, 所以不必重复添加。

    Try:
    git lg
    git ll
    git lg --stat
    git ll --stat

    我自己看log 比带 -number 参数。

    立刻体验:
    git log --color --graph --pretty=format:'%c(yellow)%h%creset -%cred%d%creset %s %c(bold blue)(%cn %cr)%creset'

    git log --color --pretty=format:'%c(yellow)%h%creset -%cred%d%creset %s %c(bold blue)(%cn %cr)%creset' --no-merges

    贴一下Gist, 其实,也没高亮……
    第 1 条附言  ·  2012-11-21 22:28:30 +08:00
    12. International *macvim-international*

    When editing non-English text it may be convenient to keep separate keyboard
    layouts for normal and insert mode. This is supported via the 'imd' option on
    Mac OS X 10.5 or later (on 10.4 the 'imd' option support is not as useful as
    it only switches between Roman and non-Roman input sources and it has been
    known not to work very reliably).

    For example: When 'noimd' is enabled (i.e. IM is enabled) the input source is
    saved when toggling between normal and insert mode, so you can use a US layout
    in normal mode then switch to insert mode and choose a Swedish layout. When
    you go back to normal mode the US layout will be selected and when you enter
    insert mode the Swedish layout is selected. This also works when searching
    for text etc. see 'imc', 'imi', 'ims'.

    我现在的配置
    se noimd
    se ims=1
    第 2 条附言  ·  2012-11-22 11:42:04 +08:00
    上条附言是发错了- -。增加附言会上首页?
    5 条回复    1970-01-01 08:00:00 +08:00
    iceseaboy
        1
    iceseaboy  
       2012-06-26 12:45:55 +08:00
    沙发~!
    期待超越我
    vitohe
        2
    vitohe  
       2012-06-26 13:03:50 +08:00
    tig
    liuzhoou
        3
    liuzhoou  
       2012-06-26 13:05:15 +08:00
    rrrrutdk
        4
    rrrrutdk  
       2012-06-26 13:13:28 +08:00
    [alias]
    tree = log --graph --decorate

    git tree --all
    git tree --all --stat
    git tree --all --oneline
    twocity
        5
    twocity  
       2012-11-22 08:57:41 +08:00
    thanks~
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3616 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 04:21 · PVG 12:21 · LAX 21:21 · JFK 00:21
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.