Yes, this looks like a duplicate as I can see this has been asked a few times before. But none of the other answers I saw helped me.
I've got an Umbraco installation that I want to store in Git (GitHub to be exact) and I obviously want to omit log files and temp files that Umbraco creates.
I've got the following in my .gitignore file:
App_Data/TEMP/
App_Data/Logs/
App_Data/ClientDependency/
App_Data/Preview/
However, it does not work. Files in those directories still get added.
I've tried putting an asterisk on the end (docs say it shouldn't be needed - and it only deals with files in that directory if it is there.)
I've ensured there are no spaces at the end of each line.
I've double checked the capitalisation of the directory names.
I've swapped around the slashes from one way to the other.
If I put in the full path from the root of the repository it does work, but that's too specific. (Although I'm going to use that as a work around for the moment). I'd like to be able to reuse the .gitignore file easily if we create new Umbraco based projects.
Other rules that don't put in the full path (e.g. NuGet's packages folder) are being correctly processed.
packages/
That rule works - And I don't really see the difference.
Can anyone see what I'm doing wrong here?
UPDATE
The full path that works is this:
/src/Company.Client.Web/App_Data/Logs/
/src/Company.Client.Web/App_Data/TEMP/
/src/Company.Client.Web/App_Data/ClientDependency/
/src/Company.Client.Web/App_Data/Preview/
(I've obfuscated a bit of it, but that's what is there now)
Here's what GitHub for Windows is showing:
Update 2
The .git folder is at the root of the repository, so /
. In other words D:\github\RepositoryName\.git\
, for comparison the src
folder is D:\github\RepositoryName\src\