Copied to clipboard

Flag this post as spam?

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


  • Romix2017 23 posts 183 karma points
    Jun 01, 2017 @ 16:55
    Romix2017
    0

    gitignore rules

    Very good day to you! I have some problem with making gitignore rule for umbraco project, I want to ignore content of the TEMP folder and Logs folder, I checked different versions, include: /AppData/TEMP/, /AppData/TEMP/*, /AppData/TEMP// but none of them worked for me, I have still the same files for commit in changes section, however, when I write Bin/ then all subfolders in the folder bin exluded from changes section, also I tried to exclude whole folder appdata, by writting following rule: App_Data/, but again this doesn't work and I don't understand why, the same folder Bin is perfectly react on the similar rule. enter image description here

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Jun 02, 2017 @ 09:00
    David Brendel
    0

    Hi Romix2017,

    I mostly use the VisualStudio gitignore from github in addition with this one: https://github.com/github/gitignore/blob/master/Umbraco.gitignore

    Regards David

  • David Hutson 48 posts 379 karma points
    Jun 02, 2017 @ 09:13
    David Hutson
    100

    Hi

    Like David I use a combination VisualStudio gitignore from github and Gitignore IO

    Here is a snippet from my gitignore file that might help.

    # =========================
    # Files in bin folders
    # =========================
    Site/[Bb]in/*
    
    # =========================
    # Value Converters
    # =========================
    BuildPackage/artifacts/*
    BuildPackage/Package/*
    
    # =========================
    # Umbraco
    # =========================
    Site/App_Data/umbraco.config
    Site/App_Data/preview/*.config
    Site/App_Data/TEMP/ClientDependency/
    Site/App_Data/TEMP/DistCache/
    Site/App_Data/TEMP/ExamineIndexes/
    Site/App_Data/TEMP/PluginCache/*
    Site/App_Data/TEMP/SEOChecker/
    Site/App_Data/TEMP/Razor/
    Site/App_Data/umbraco.licensing.log.txt
    Site/aspnet_client/
    Site/App_Data/*.udt
    Site/App_Data/NuGetBackup/*
    Site/App_Data/Logs/*
    Site/Media/*
    # =========================
    # ImageProcessor DiskCache
    # =========================
    Site/App_Data/cache/*
    
    # =========================
    #Grunt, Sass & Bower
    # =========================
    **/node_modules
    **/node_modules/*
    **/.sass-cache
    **/.sass-cache/*
    **/bower_components
    **/bower_components/*
    Site/lib/*
    Site/css/lib/*
    Site/scripts/lib/*
    Site/css/main.css
    Site/css/main.css.map
    
    Site/dist/
    
    
    # Ignore Umbraco content cache file
    !**/App_Data/umbraco.config
    !**/App_Data/umbraco.sdf
    
    # 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
    

    Dave

  • Romix2017 23 posts 183 karma points
    Jun 03, 2017 @ 16:12
    Romix2017
    0

    Thank you for answering, I put those rules in my .gitignore file but again when i do something in umbraco, i see that Visual Studio wants to commit changes from TEMP folder, though the rule is clear about that pathenter image description here

  • David Hutson 48 posts 379 karma points
    Jun 03, 2017 @ 17:56
    David Hutson
    0

    Hi,

    You might have another rule that is overwriting the exclusion behaviour later on in the file.

    Also I don't think you need the trailing asterisk on the end. I have recreated the folder structure locally and it works for me.

    One thing to check, the .gitignore file works on relative paths from where the .gitignore file is placed. Check its in the right location.

    Last resort you could exclude the file extension type e,g. *.hash *.list

    Dave

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Jun 03, 2017 @ 20:11
    Nicholas Westby
    1

    Are the files already in Git? If so, you'll have to delete them (and commit that deletion). Git ignore rules don't seem to work for file modifications (only new files will be ignored).

  • Romix2017 23 posts 183 karma points
    Jun 11, 2017 @ 10:37
    Romix2017
    0

    Ok, thanks a lot, just deleted local git repository and created a new one by using provided set of gitignor rules, thank you very much!

  • Jon R. Humphrey 164 posts 455 karma points c-trib
    Oct 11, 2017 @ 22:34
    Jon R. Humphrey
    2

    If you do update your gitignore file, you can run the following commands in your git bash (or whatever you're using) to "reset" your commits instead of recreating the whole repo:

    git rm -r --cached . <- note the full stop

    This removes all the currently cached files in your repo

    git add . <- again note the full stop

    This adds everything back to the repo according to the "new" gitignore rules you've just added or updated

    git commit -m "gitignore updated" <- or something along these lines!

    This commits all changes to the head so everything is ready for the next push!

    Hope this helps!

Please Sign in or register to post replies

Write your reply to:

Draft