Reputation: 4234
git add *.filetype is not working on one of my projects. Works on every other project. Any ideas what can be wrong?
Upvotes: 0
Views: 148
Reputation: 116048
You can use old find
/xargs
trick to recursively add files of one extension (or any other mask for that matter):
find -name "*.php" -print0 | xargs -0 git add
If you are certain that file names never have any spaces, you can simplify this as:
find -name "*.php" | xargs git add
Upvotes: 0
Reputation: 1245
You are in a different folder from the changed files. As far as I know git just uses the shell's built-in expansion for this. If it has its own different expansion then I'm not sure why it doesn't work in this case.
Possible workaround (assuming this is a properly configured bash shell):
git add **/*.php
You might need to switch on the globstar shell config variable shopt -s globstar
for this to work if it isn't already set.
Upvotes: 2