Copied to clipboard

Flag this post as spam?

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


  • Andrew 52 posts 234 karma points
    May 06, 2021 @ 17:27
    Andrew
    0

    Is there a new reference for what to include in gitignore in V9

    Hi,

    I'm wondering if there is somewhere I can find a new reference for what to put in the gitignore file for an Umbraco V9 project.

    Thanks, Andrew

  • Marco Graziotti 40 posts 166 karma points c-trib
    May 18, 2021 @ 18:13
    Marco Graziotti
    0

    Hi Andrew,

    I used the ".gitignore" file that you can find in the official GitHub. This is the file for the "Umbraco 9 beta-002" release.

    Of course, if you are using Visual Studio, don't remove the records added by default.

    Best

  • Andrew 52 posts 234 karma points
    May 19, 2021 @ 17:00
    Andrew
    1

    Humm,

    That seems to be the gitigore for Umbraco itself rather than for a project using Umbraco

  • Marco Graziotti 40 posts 166 karma points c-trib
    May 20, 2021 @ 18:02
    Marco Graziotti
    0

    Yes, I think you are right.

    For now, I added this Visual Studio Git Ignore rules, and I also added these folders, because they were present in Umbraco 8, under a different path, in App_Data:

    # Ignore unimportant folders generated by Umbraco
    **/umbraco/Logs/
    **/umbraco/Data/TEMP/
    
    # Ignore the Models Builder models out of date flag
    **/umbraco/models/ood.flag
    

    Here you can find the old Git Ignore for the v8.

    N.B.: After adding these rules, if you run the solution and you continue to see the "TEMP's" descendant folders ready for the next commit, it probably means that you have already done a commit, and you need to reset the "git's" cache.

    In Visual Studio you can do this using the "Package Manager Console", executing these two commands:

    1. git rm -r --cached . (dot is relevant)
    2. git add .

    Don't worry if after the second command, you get several warnings about the replacement of the new line characters:

    warning: LF will be replaced by CRLF in Umbraco.Test.Backoffice/wwwroot/umbraco/lib/angular-i18n/angular-locale_pt-gq.js. The file will have its original line endings in your working directory

    After the second command, looking at the Visual Studio "Git Changes" panel, you will see all the rules correctly applied.

    Let me know if this works for you.

  • Andrew 52 posts 234 karma points
    May 20, 2021 @ 18:27
    Andrew
    0

    Thanks for the suggestions,

    I'll have a look when I'm able to get back to my Umbraco experimentation.

  • David Armitage 510 posts 2081 karma points
    Jun 15, 2021 @ 07:39
    David Armitage
    100

    Hi Andrew,

    Hi All,

    Just posting here.

    I wrote a couple of articles regarding this.

    What to exclude from Git https://www.umbrajobs.com/blog/posts/2021/june/umbraco-9-git-ignore/

    I am constantly building on to this as and when I notice something is not quite right.

    Protecting connection strings https://www.umbrajobs.com/blog/posts/2021/june/umbraco-9-protecting-connectionstrings-from-git/

    Hope this helps.

    Regards

    David

  • Søren Kottal 713 posts 4571 karma points MVP 6x c-trib
    Jun 15, 2021 @ 19:40
    Søren Kottal
    0

    Very useful - thanks for sharing!

  • jake williamson 207 posts 873 karma points
    Jan 25, 2022 @ 04:26
    jake williamson
    0

    old post i know... but thought i'd throw this out there...

    we've been using https://www.toptal.com/developers/gitignore/ to generate gitnore files for a while now - and it's been updated to work with core and v9:

    https://www.toptal.com/developers/gitignore/api/aspnetcore,umbraco,visualstudio

    nice!

Please Sign in or register to post replies

Write your reply to:

Draft