3 ms·
And you can see this structure if you add to any "git log" command "--graph --oneline --decorate --color". IIRC some of those are unnecessary in recent version
by Izkata 7y ago
And you can see this structure if you add to any "git log" command "--graph --oneline --decorate --color". IIRC some of those are unnecessary in recent versions of git, I just remember needing all of them at the point I started using it regularly.
I have a bash function for it (with a ton of other customizations, but it boils down to this):
function pwlog() {
git log "$@" --graph --oneline --decorate --color | less -SEXIER
}
pwlog --all -20
(...in that "less" command, "S" truncates instead of wraps lines, one "E" exits at EOF, "X" prevents screen-clearing, and "R" is to keep the color output. The second "E" does nothing special, it and "I" (case-insensitive search) are just to complete the word)
- westurner 7y agoYou can also set $GIT_PAGER/core.pager/$PAGER and create an alias to accomplish this: #export PAGER='less -SEXIER' #export GIT_PAGER='less -SEXIER' git config --global core.pager 'less -SEXIER' git config --global alias.l 'log --graph --oneline --decorate --color' # git diff ~/.gitconfig git l core.pager: https://git-scm.com/docs/git-config#Documentation/git-config.txt-corepager https://git-scm.com/docs/git-config#Documentation/git-config... > The order of preference is the $GIT_PAGER environment variable, then core.pager configuration, then $PAGER, and then the default chosen at compile time (usually less).