My .gitignore
file looks like:
html/ cache/ resources/ # Temp files often created by editors *.~
I know wish to start tracking a specific directory in html, so I add `!html/support/
html/ cache/ resources/ # Temp files often created by editors *.~ # Track support !html/support/
After doing so, however, Git still doesn't seem to track html/support/ and all its children.
How do I add a previously ignored directory to Git repository?
Open Visual Studio and the solution needing an ignore file. From the top menu select Git > Settings. The above will open Visual Studio's Options with Source Control > Git Global Settings selected. From the list on the left select Git Repository Settings and then click the Add button for Ignore file.
Repository exclude - For local files that do not need to be shared, you just add the file pattern or directory to the file . git/info/exclude . Theses rules are not committed, so they are not seen by other users. More information is here.
Not ignoring doesn't mean tracking.
Just use
git add html/support/
at the root of your git repository.
If the file is still ignored, though, you can use git add -f
to force adding it (this will not modify the .gitignore
file, just allow one little exception) :
git add -f html/support/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With