Created
December 22, 2020 15:42
-
-
Save jsit/d7a0b462c7423adbd04e0da5cdf0b978 to your computer and use it in GitHub Desktop.
Git config with conditional to test Git version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
lg = "!if (( \ | |
$(echo \"$(git --version | sed -E 's/git version ([0-9]+.[0-9]+).*/\\1/') > 2.20\" | bc) \ | |
)); then \ | |
DATE="--date=human"; \ | |
else \ | |
DATE="--date=short"; \ | |
fi; \ | |
git log --pretty=tiny --abbrev-commit --$DATE" | |
[pretty] | |
tiny = format:%C(dim yellow)%h %C(dim blue)%<(16)%ad %C(italic dim black)%>(16,trunc)%an%C(auto) %s%d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment