So I'm pretty familiar with git, but have always had a repo master that has created a .gitignore file for me, so this is my first time dealing with it by myself. My problem is that when I commit my Unity project, and pull it from a different computer, the metafiles have been ignored (I suspect), and all of the GameObjects in my scene get deleted. Here is the tutorial I followed with the gitignore file I am using.
Unity project's .gitignore is ignoring meta files
3.8k views Asked by tommyhawk At
2
There are 2 answers
3
On
I have seen lots of people make these huge .gitignore
files, when really all they need to do is this:
# Ignore Everything
/*
# Except for these:
!/.gitignore
!/Assets
!/ProjectSettings
What this is doing, is:
- Ignore everything
- Then it un-ignores the rest
- The
.gitignore
file - The
Assets
folder - The
ProjectSettings
folder
- The
This should the not ignore your meta files, or anything in the Assets
folder for that matter.
GitHub provide a comprehensive .gitignore file for Unity projects that you can choose when setting up your repository.
It is also available here if you are using a different provider.