0

I am very new to git. I have a .gitignore in the my working folder.

*.jpg
*.gif
*.png
system/*
*/Zend/*
.idea/*.*

Well, I did git init and then git add *. At this it worked fine and ignored the above files. But when I did some changes, ran the same command it puts the ignored files into staging area. The reason why I am using git add * is because I work on many files and adding each file would be a overkill.

Update: Here are messages when I run git add * second time..

#new file:   application/vendors/Zend/XmlRpc/Value/String.php
#new file:   application/vendors/Zend/XmlRpc/Value/Struct.php
...

The list is too long.

Shubham
  • 21,300
  • 18
  • 66
  • 89

2 Answers2

4

According to the information in this question:

wildcards in the pattern will not match a / in the pathname

therefore, I think the rule for the Zend directory is not correct.

Community
  • 1
  • 1
madth3
  • 7,275
  • 12
  • 50
  • 74
0

git add * should complain if you have a .gitignore. See this SO question and answer. I'm not sure why it's not complaining.

Try using git add . instead as that's what you really want. Similar problem to this SO Q&A.

Community
  • 1
  • 1
embedded.kyle
  • 10,976
  • 5
  • 37
  • 56
  • I am not sure what i could have done wrong? I checked there is no spelling mistake. Just a fact that I placed `.gitignore` also in my `.git` folder because it was not working. – Shubham Jul 06 '12 at 15:16
  • I've had weird issues with `.gitignore` not working on Windows before. Have you tried using `.git/info/exclude` instead? – embedded.kyle Jul 06 '12 at 15:24
  • Well I think I have caught the catch. The new files are getting listed via `git status` which I thought list all staged files but I think it doesn't (may be). – Shubham Jul 06 '12 at 15:27
  • `git status` should not be showing ignored files: http://www.kernel.org/pub/software/scm/git/docs/git-status.html And you really should be using `git add .` instead. – embedded.kyle Jul 06 '12 at 15:31