Copied to clipboard

Flag this post as spam?

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


  • David Armitage 510 posts 2082 karma points
    Jun 06, 2021 @ 13:04
    David Armitage
    0

    Umbraco 9 - What to exclude from Git and add the the Git Ignore file

    Hi All,

    I was wondering if anyone has a git ignore they have put together for Umbraco 9.

    What should be be keeping in Git and what should we be ignoring with the new Umbraco 9 .Net Core version.

    I am guessing there is already a git template floating around somewhere?

    Kind Regards

    David

  • Benjamin Carleski 33 posts 294 karma points MVP c-trib
    Jun 07, 2021 @ 15:40
    Benjamin Carleski
    101

    I haven't done a very extensive site yet, but I found if I just excluded the regular VS things, then Umbraco compiled stuff and the media directory, that seemed to do it for me.

    For a basic site, this seemed to work fine - https://github.com/ProworksDevTeam/CG2021-HeadlessUnicore-Backend/blob/master/.gitignore

    obj/
    bin/
    umbraco
    wwwroot/media
    wwwroot/umbraco
    
  • David Armitage 510 posts 2082 karma points
    Jun 09, 2021 @ 12:34
    David Armitage
    0

    Noted. I also moved the models to a friendly folder too.

    That's probably the best idea for Git too. That way you can check on the models without having to re-generate.

    Thanks Benjamin.

  • Benjamin Carleski 33 posts 294 karma points MVP c-trib
    Jun 07, 2021 @ 15:42
    Benjamin Carleski
    0

    Note that I did update the ModelsBuilder config to generate code files for my models, and put them in a directory outside the umbraco folder, so you'd need to do that as well. See the config changes at https://github.com/ProworksDevTeam/CG2021-HeadlessUnicore-Backend/blob/master/appsettings.Development.json#L35

  • Mark Drake 134 posts 458 karma points c-trib
    Jun 11, 2021 @ 04:31
    Mark Drake
    1

    Please note that GitHub themselves have a repo for commonly used .gitignore files.

    This is the one for Umbraco 8 (I imagine). If it were me, I'd want the version number appended to this file.

    It would be great if a new version could be added specifically for Umbraco 9.

  • David Armitage 510 posts 2082 karma points
    Jun 11, 2021 @ 04:54
    David Armitage
    0

    Yeah I have always been reluctant to use the ones stored within Git because of this.

  • David Armitage 510 posts 2082 karma points
    Jun 15, 2021 @ 07:39
    David Armitage
    2

    Hi All,

    Just posting here. I wrote a couple of articles which are a biut more complete. A few extra things not to include in Git and also some information on how to protect your connection strings and sensitive data.

    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/

  • jake williamson 207 posts 873 karma points
    Jan 25, 2022 @ 04:25
    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!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies