- Home /
Help with using Git for version control
I just found how to set up external version control with Unity but I am having problems as I entered /Library/ to be ignored in the .gitignore file but it still pushes those files to the repository. anyone that uses git know why it doesn't ignore that folder?
Answer by Tarlius · Mar 01, 2013 at 05:46 AM
Did you do a commit before you added them, perhaps?
If not, you may need to add some wildcards (*). Also note that you probably do want the .assets included in git. Here is the .gitignore from my project:
.DS_Store
Temp/*
Library/previews/*
Library/ScriptAssemblies/*
Library/cache/*
Library/metadata/*
Library/*
!Library/*.asset
*.userprefs
*.sln
I tried the wildcards but it still didn't work. I'm using Github's git application so I am wondering if for reason that even if it's listed in the gitignore file it will still add it no matter what. Do you use Github's app or do you use something else?
I use Tower, but as far as I know they are all just wrappers for command-line git so I would think it makes no difference. If you made a commit before adding the .gitignore its possible you may have to manually remove them though.
You did "Library/" and not "/Library/", right? It might make a difference.
Yes and I added the .gitignore file and commited before adding back the Library folder and the Github app still shows them for syncing.
Where is your .gitignore file?
And are you certain you didn't typo the name?
If not, I'm running out of ideas fast :(
I have it in the root folder. I tried with TortoiseGit and it ignores the files so I am thinking that there might be something wrong with how gitignore files are read with the github app.
Thanks for helping me out as I guess I'll be using TortoiseGit for now. If you know of any better Git tool please let me know. Again thanks for your help.
Answer by steakpinball · Mar 01, 2013 at 11:13 AM
Once a file has been committed to git any ignore rules which include it do not apply to it. Remove it from version control by committing deletion of the file.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Imported Maya File mesh missing after Git sync 1 Answer
What is the best method for collaboration in very small teams (2-3 people)? 1 Answer
Addforce - bug with jump 2 Answers
Rename a project on the asset server? 3 Answers