Reputation: 3589
I want to use git to add all the files under the repo exclude the .gitignore contains:
I use git add *
, but it will says:
$ git add *
The following paths are ignored by one of your .gitignore files:
media
venv
Use -f if you really want to add them.
I don't want to add them, and I just want to add the all files exclude the .gitignore write. and looking for a simple way to do that, like add *
, but it reports the upper issue. so in my case, I only can add one by one.
Is there a convenient way to realize that?
Upvotes: 0
Views: 55
Reputation: 489918
Running:
$ git add *
when *
matches, say, foo.c foo.h foo.o
or foo.cc foo.h foo.o
, and your .gitignore
says to ignore *.o
, produces that warning—but it has added all but the .o
file. (Or, in your case, it has added all but media
and venv
.) So you do not have to do anything different here.
If you wish to avoid the warning, though, you can run git add .
instead. The key difference on a Unix/Linux machine is that git add .
will add dot-files, if they are not ignored, that git add *
will skip because the shell's expansion of *
skips them.
Upvotes: 0
Reputation: 83
I believe there are some files that you have mentioned in the .gitignore file like media, venv. Git just indicates you that its not added. Otherwise all other files that you added should already be added. You can check the same with "git status" to see the list of added files.
Upvotes: 1