The shortest possible output from git log containing author and date

前端 未结 13 1690
我在风中等你
我在风中等你 2020-12-02 03:12

How can I show a git log output with (at least) this information:

* author
* commit date
* change

I want it compressed to one line per log

13条回答
  •  萌比男神i
    2020-12-02 03:57

    Note the -10 at the end, to show only the last 10 entries.

    Use predefined git alias (hs - short for history):

    git hs
    

    Created once by command:

    git config --global alias.hs "log --pretty='%C(yellow)%h %C(cyan)%ad %Cblue%an%C(auto)%d %Creset%s' --date=relative --date-order --graph"
    

    %h = abbreviated commit hash
    %ad = author date (format respects --date= option, so you can adjust it later)
    %an = author name
    %d = ref names
    %s = subject

    Reference: https://git-scm.com/docs/git-log#_pretty_formats

提交回复
热议问题