参考自How to use Git for Unity source control?
1.首先在项目根目录新建一个.gitignore文件,可以从https://github.com/github/gitignore/blob/master/Unity.gitignore 这里获取
2.然后在Unity3D中进行设置:
For versions of Unity 3D v4.3 and up:
1.(Skip this step in v4.5 and up) Enable External option in Unity → Preferences → Packages → Repository.
2.Open the Edit menu and pick Project Settings → Editor:
Switch Version Control Mode toVisible Meta Files.
Switch Asset Serialization Mode toForce Text.
3.Save the scene and project from File menu.