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.
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.
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
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
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.
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
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.
Yeah I have always been reluctant to use the ones stored within Git because of this.
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/
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!
is working on a reply...