I’m trying to ignore the bin folder of a web project, but include the .refresh files that are in that bin folder.
Here’s what I have in my .gitignore:
[Bb]in/
#Allow .refresh files for web sites
![Bb]in/*.refresh
But this isn’t working. What am I doing wrong? I’ve also tried:
!*.refresh
With the same results.
Update:
Here’s the file structure if that helps diagnose this:
\rootfolder
.gitignore
\project1
\bin
file1.dll
file1.dll.refresh
You can see where our gitignore file is located. We don’t want the .dll but we do want the .refresh file.
Try doing below:
this is because when you just do bin or bin/ it will not descend into the folder at all to look for file. You will have to explicitly say, go to folder, but ignore everything and then say dont ignore *.refresh.
Edit for OP’s structure:
Then you will have to either
1) Include project1 in the path in your .gitignore:
or
2) Add a .gitignore inside project1 ( I recommend this) with the previous content.