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.
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 path
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).
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!
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.
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
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.
Dave
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 path
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
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).
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!
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 stopThis removes all the currently cached files in your repo
git add .
<- again note the full stopThis 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!
is working on a reply...