I've recently setup a new project in Visual Studio and I plan to use Git for version control. The issue I have is the App_Data folder, even though it's set to be ignored in Visual Studio, still shows up when I go to make commits.
Is there a way to ignore this folder? I've added
# Umbraco
# Ignore unimportant folders generated by Umbraco
**/App_Data/Logs/
**/App_Data/[Pp]review/
**/App_Data/TEMP/
**/App_Data/NuGetBackup/
# Ignore Umbraco content cache file
**/App_Data/umbraco.config
# Don't ignore Umbraco packages (VisualStudio.gitignore mistakes this for a NuGet packages folder)
# Make sure to include details from VisualStudio.gitignore BEFORE this
!**/App_Data/[Pp]ackages/*
!**/[Uu]mbraco/[Dd]eveloper/[Pp]ackages/*
# ImageProcessor DiskCache
**/App_Data/cache/
# Ignore the Models Builder models out of date flag
**/App_Data/Models/ood.flag
To my gitignore file but that doesn't seem to make a difference.
Just added that to the ignore file but I've still got a list of changes showing, all within the App_Data folder. Even if I undo the changes, the next time I run the site locally, all the files change and then I'm prompted to commit them all again!
Hmm, have those files been comitted by mistake previously? Because then I think that might be the issue then since the folder will already be in the index.
Cheers Jan.
I ended up going on to Visual Studio Online and deleting these files. Then sync'ing my local enviroment with VSO. All seems to be working now.
I came across the same problem recently. If the file you try to ignore has already been commited in the past, it will never ignore it no matter what you do.
Its logic is something like 'you either ignore it now or never'.
Ignoring App_Data folder in Git version control?
Hi,
I've recently setup a new project in Visual Studio and I plan to use Git for version control. The issue I have is the App_Data folder, even though it's set to be ignored in Visual Studio, still shows up when I go to make commits.
Is there a way to ignore this folder? I've added
To my gitignore file but that doesn't seem to make a difference.
Thanks in advance,
O.
Hi Owain
Just had a look at our .gitignore file and in it we have
Could you try adding this? This one line should be enough to ignore the folder and it's contents so you don't have to do all of the above lines.
I hope this helps :)
/Jan
Hi Jan,
Just added that to the ignore file but I've still got a list of changes showing, all within the App_Data folder. Even if I undo the changes, the next time I run the site locally, all the files change and then I'm prompted to commit them all again!
O.
Hmm, have those files been comitted by mistake previously? Because then I think that might be the issue then since the folder will already be in the index.
I think you should be able to solve it using the mentioned approach in this SO post https://stackoverflow.com/questions/38303979/git-ignore-a-specific-file-in-eclipse/38304114#38304114
/Jan
Cheers Jan. I ended up going on to Visual Studio Online and deleting these files. Then sync'ing my local enviroment with VSO. All seems to be working now.
O.
That's of course also a way around it. I'm happy to hear you managed to fix the issue - Happy coding mate! :-)
/Jan
I came across the same problem recently. If the file you try to ignore has already been commited in the past, it will never ignore it no matter what you do.
Its logic is something like 'you either ignore it now or never'.
As in, it's not only App_Data folder specific
is working on a reply...