Was trying to commit some changes. I used git add
to add any new javascript files that I may have created using the wildcard *.js
. Then I committed cha
An alternative is to use the find command:
find . -name '*js' -exec git add {} \;
Running that without the exec will give you the list of files that you are working on; so, it is easy to tune this command to your liking.
You need to use
git add '*.js'
You have to use quotes so git receives the wildcard before your shell does. If you do not have quotes the shell will only do the wildcard search within your current directory.
even though I had just added them using the wildcard:
git add *.js
Shell wildcard expansion does not recurse into subdirectories. The wildcard is expanded before Git gets a chance to see it.
If you use git add '*.js'
, then Git will see the wildcard and will match it against all path names that end in .js
. Because the *
is in the initial position, this will end up recursively adding all .js
files including in subdirectories.