Created
February 27, 2015 10:12
-
-
Save raine/e91a245a61f2e73be739 to your computer and use it in GitHub Desktop.
git add with grep
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
[alias] | |
grep-add = "!sh -c 'git ls-files -m -o --exclude-standard | grep $1 | xargs git add' -" | |
grep-add-patch = "!sh -c 'git add -p `git ls-files -m -o --exclude-standard | grep $1`' -" |
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
alias gga='git grep-add' | |
alias ggap='git grep-add-patch' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
single alias for
git add -p
with and without grep