user2579721
user2579721

Reputation: 89

Specify files with *

I am running Git Bash and GUI under Windows XP thus in a mingw environment.

I created two files, a and b, with vi, added them and then committed them. Then I modified both again, then using git bash added a but not b. Git GUI verified that a was staged but not b.

Next I typed the following:

git commit -m "Staged a, not b, committing with * file specifier" *

Git GUI indicates that both were committed.

I repeated the experiment but used GUI to attempt the commit. It only committed file a.

Is the * file specifier a problem?

Upvotes: 1

Views: 48

Answers (1)

Etan Reisner
Etan Reisner

Reputation: 80931

Short answer: Yes.

Longer answer: Yes, because you told git to commit the files you specified instead of letting it commit the already staged changes.

From the git-commit man page:

<file>…

When files are given on the command line, the command commits the contents of the named files, without recording the changes already staged. The contents of these files are also staged for the next commit on top of what have been staged before.

Upvotes: 1

Related Questions