Skip to content

Instantly share code, notes, and snippets.

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