I was working on a vistual studio c/C++ project which was not under any version control, All the files were in a my-project directory,
I thought it’s time to put it under version control , I copied a .gitignore file my project folder and opened git bash navigated to project directory and did
git init
git add .
Assuming it would obey the .gitignore file. What happened is it has stage all of my files disregarding the .gitignore file so all files under debug folder , release folder obj files etc are all staged
my .gitignore looks like this, template was taken from a wiki answer on stackoverflow about visual studio project git ignore template.
Can you help how to unstage all the files and make them filtered through gitignore ??
#OS junk files
[Tt]humbs.db
*.DS_Store
#Visual Studio files
*.[Oo]bj
*.user
*.aps
*.pch
*.vspscc
*.vssscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.[Cc]ache
*.ilk
*.log
*.lib
*.sbr
*.sdf
*.opensdf
*.unsuccessfulbuild
ipch/
obj/
[Bb]in
[Dd]ebug*/
[Rr]elease*/
Ankh.NoLoad
#MonoDevelop
*.pidb
*.userprefs
#Tooling
_ReSharper*/
*.resharper
[Tt]est[Rr]esult*
*.sass-cache
#Project files
[Bb]uild/
#Subversion files
.svn
# Office Temp Files
~$*
#NuGet
packages/
#ncrunch
*ncrunch*
*crunch*.local.xml
# visual studio database projects
*.dbmdl
#Test files
*.testsettings
After you get the right
.gitignorefile with the correct encoding at the right place, you can type:Then add all the files again :