Created
May 18, 2017 04:02
-
-
Save jspiro/62f9c4f93a3ccf6c5f751e23de75a012 to your computer and use it in GitHub Desktop.
git aliases for managing autogenerated code
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
# autogen files are files with diff unset in .gitattribute | |
ls-check-attr-diff = "!git ls-files --exclude-standard --modified | git check-attr --stdin diff" | |
ls-autogen = "!git ls-check-attr-diff | grep 'diff: unset' | sed 's/: diff:.*//'" | |
ls-no-autogen = "!git ls-check-attr-diff | grep -v 'diff: unset' | sed 's/: diff:.*//'" | |
discard-autogen = "!git ls-autogen | xargs git checkout --" | |
add-autogen = "!git ls-autogen | xargs git add" | |
add-no-autogen = "!git ls-no-autogen | xargs git add" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment