Skip to content

Instantly share code, notes, and snippets.

@jsit

jsit/.gitconfig

Created Dec 22, 2020
Embed
What would you like to do?
Git config with conditional to test Git version
[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