Created
November 16, 2015 08:33
-
-
Save bimlas/0a3795b6fa89adc7ce7a to your computer and use it in GitHub Desktop.
Using of variables in Git aliases
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
# Simplify the similar aliases in .gitconfig by using variables instead of | |
# copying the same flags. | |
[alias] | |
flags = "!FLAG_LOG='--graph --decorate --find-renames --date-order'; \ | |
FLAG_DIFF='--patch --stat --ignore-blank-lines';" | |
glog = "!git flags; git log $FLAG_LOG --name-status" | |
gslog = "!git flags; git log $FLAG_LOG --stat" | |
slog = "!git flags; git log $FLAG_LOG --date=short --format='%C(auto)%h%C(auto)%d %C(bold blue)%ad %an%n %s%C(reset)'" | |
df = "!git flags; git diff $FLAG_DIFF" | |
dfc = "!git flags; git diff $FLAG_DIFF --cached" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment