Behavior of 'git add \*.txt': bug or feature?

From: Matthieu Moy <hidden>
Date: 2016-06-15 22:47:25

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/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help