I ignore the folder "Debug" using .gitignore. But in "Debug" there is a folder "Docs" that I want to keep (also the files in there). So how do I have to configure .gitignore to only keep the folder "Docs" with its files but ignore all the rest of "Debug"?
1 Answer
It is very simple. Just follow these steps:
- Remove the entry of your debug folder from your .gitignore file.
- In the debug folder, create a new .gitignore file and write these two lines in it.
*
!Docs
It will ignore everything in your debug folder except docs folder and its content.
git add -f path-to-file(s)
, but I'm not sure you can easily manage this. Why is the folder placed underDebug
, and is this a .NET Project? If it is, then you should definitely not put files you want to keep inside theDebug
folder.