git add all except ignoring files in .gitignore file

Viewed 92288

I am adding source control to a project that had none. The problem is that there are a lot of files to initially add to git with a .gitignore file, but I can't figure out how to add all files without including the files matching something in the .gitignore file.

git add *

The above command will not add any files because it detects files which are ignored by the .gitignore.

git add -f *

The above command will add all files including the files I wish to ignore.

So, how do I add all files while still adhering to the .gitignore file?

5 Answers

Mine still include files i told it to ignore, so i did this... i added to gitignore -> " .gitignore " then i tried " git status ", and the file i wanted ignored were ignored.

Related