Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Owain Williams 326 posts 978 karma points MVP c-trib
    Jul 24, 2018 @ 09:51
    Owain Williams
    0

    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.

    enter image description here

    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.

    Thanks in advance,

    O.

  • Jan Skovgaard 11152 posts 22857 karma points MVP 5x admin c-trib
    Jul 24, 2018 @ 10:08
    Jan Skovgaard
    0

    Hi Owain

    Just had a look at our .gitignore file and in it we have

    /[Aa]pp_[Dd]ata/
    

    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

  • Owain Williams 326 posts 978 karma points MVP c-trib
    Jul 24, 2018 @ 10:27
    Owain Williams
    0

    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.

  • Jan Skovgaard 11152 posts 22857 karma points MVP 5x admin c-trib
    Jul 24, 2018 @ 10:35
    Jan Skovgaard
    100

    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

  • Owain Williams 326 posts 978 karma points MVP c-trib
    Jul 24, 2018 @ 10:52
    Owain Williams
    1

    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.

  • Jan Skovgaard 11152 posts 22857 karma points MVP 5x admin c-trib
    Jul 24, 2018 @ 10:57
    Jan Skovgaard
    0

    That's of course also a way around it. I'm happy to hear you managed to fix the issue - Happy coding mate! :-)

    /Jan

  • Harry Spyrou 138 posts 398 karma points
    Jul 25, 2018 @ 15:13
    Harry Spyrou
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft