After pulling the changes that a teammate did, I open our unity project and just after opening and closing it, without making any changes to it, GitHub Desktop is showing thousands of changes to commit. Is this because of the lack of a .gitignore in our repo? What should I do to make sure I am not corrupting the file or causing compilation errors when our teammate is re-opening the project, since some of these "changes" appear to be deleted files. Again, I make no changes, just open and close the unity file, in the same editor version with all of my teammates. I uploaded the image, showing these "changes".
Asked
Active
Viewed 974 times
3
-
Do not include `Library` folder in your repository, it contains generated contents. In general you need 3 folders for a unity project: `Assets`, `ProjectSettings`, `Packages`. – shingo May 22 '22 at 09:34
-
Hi @shingo, thank you for your comment. Please bear with me since this is the first time I'm using collaboration tools. So you're saying if I create a .gitignore and include the Library folder in that, I wouldn't run into this problem, and the project wouldn't be harmed? – Sevcan D. May 22 '22 at 09:41
-
No, the folder is not important, You need to reimport the project at most if it is deleted. – shingo May 22 '22 at 09:46
-
I've just realized that the standard .gitignore file for Unity projects already includes the Library folder, exactly like you've said. Thank you so much, I believe this will work. I still want to keep the question open for any answers, if you wouldn't mind? – Sevcan D. May 22 '22 at 09:49
-
That's the correct answer, you can reply by yourself on topic by editing the question. You needed the .gitignore file for Unity. – Yuris May 22 '22 at 09:57
-
Thank you so much @Yuris . I'll post your answers as the solution. – Sevcan D. May 22 '22 at 10:07
-
Use this one: https://github.com/github/gitignore/blob/main/Unity.gitignore – Yuris May 22 '22 at 10:09
-
I had this in our repo, then made the mistake of removing it because some files were not showing up. Just realized that that was actually the point :) Thank you again Yuris – Sevcan D. May 22 '22 at 10:14
1 Answers
0
With the help of Yuris and shingo, I've realized the lack of .gitignore was indeed the problem. Adding that to the repository will allow GitHub to stop tracking files and folders that don't need to be tracked.

Sevcan D.
- 53
- 9