Behavior of 'git add \*.txt': bug or feature?
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Sep 16, 2009, 19:46 UTC
- Message-ID
- <vpqljke7jv8.fsf@bauges.imag.fr>
Hi,
I find the behavior of 'git add \*.txt' strange: for adding untracked files, it considers \*.txt as a pattern to match, but for updating existing file's staged content, it seems to consider it as a filename:
$ git status # On branch master # Changed but not updated: # # modified: three.txt # modified: two.txt # # Untracked files: # # one.txt no changes added to commit (use "git add" and/or "git commit -a") $ git add -v '*.txt' add 'one.txt' $ git add -v '*.txt' $
I would have expected this "git add -v '*.txt'" to update the staged content of two.txt and three.txt too.
It this the intended behavior? If so, what's the rationale for this?
Thanks,
-- Matthieu Moy http://www-verimag.imag.fr/~moy/