-
-
Save raecoo/93a5bd4011da5ce97800 to your computer and use it in GitHub Desktop.
Using of variables in Git aliases
This file contains hidden or 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