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
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:
git rm -r --cached . (dot is relevant)
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.
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
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
Humm,
That seems to be the gitigore for Umbraco itself rather than for a project using Umbraco
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
: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:
git rm -r --cached .
(dot is relevant)git add .
Don't worry if after the second command, you get several warnings about the replacement of the new line characters:
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.
Thanks for the suggestions,
I'll have a look when I'm able to get back to my Umbraco experimentation.
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
Very useful - thanks for sharing!
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...