1

i'm new to using github repositories to share my unity projects, so i could be completely missing something. Basically i have a unity project inside a repository that i used just as a backup, but recentlty a frined joined the project and i had to share it with him and now everytime either one of us opens the project a bunch of changes come up on the changelog even if we did nothing but open the project. Most of the changes just say "this binary file has changed" but some look like files have been added or removed. Nothing looks or behaves differently on the project itself afterwards but the changes always come up We both use windows and have the same version of unity. i have included a gitignore file for unity in the repository.

  • 1
    Can you tell us what files have changed? Some folders should not be in version control, some files are safe to ignore but we can't tell if you don't give us more info. – frankhermes Jun 08 '21 at 17:30
  • 1
    Might be also a line ending (`\n` vs \r\n`) difference .. see e.g. [How to change line-ending settings in GIT](https://stackoverflow.com/questions/10418975/how-to-change-line-ending-settings) – derHugo Jun 08 '21 at 19:06
  • @frankhermes the number of changes is always in the hundreds when we alternate between our computers, but when i open the project just on my computer i noticed the following files always change: ```Library\ArtifactDB``` ```Library\CurrentLayout-default.dwlt``` ```Library\CurrentMaximizeLayout.dwlt``` ```Library\SourceAssetDB``` – AntonioSaintPierre Jun 08 '21 at 21:57

1 Answers1

1

Please refer to the "official" .gitignore for Unity where you can find a pretty complete list of stuff that should NOT be tracked in your version control.

This includes e.g. the entire Library folder. Reason: This folder is completely recompiled every time you open Unity so frequent changes in there are no surprise.

See also Cleaning up and Migrating existing Unity project into new one or another PC where I explained it in a bit more detail.

Then also refer to How to make Git "forget" about a file that was tracked but is now in .gitignore?

derHugo
  • 83,094
  • 9
  • 75
  • 115
  • yeah, i have the ```library``` folder in my ```.gitignore``` so i dont understand why some files from it always seem to change – AntonioSaintPierre Jun 09 '21 at 17:45
  • `library` or `Library`? Could you maybe show your `.gitignore`? – derHugo Jun 09 '21 at 17:48
  • ```/[Ll]ibrary/ /[Tt]emp/ /[Oo]bj/ /[Bb]uild/ /[Bb]uilds/ /[Ll]ogs/ /[Uu]ser[Ss]ettings/ /[Mm]emoryCaptures/ !/[Aa]ssets/**/*.meta /[Aa]ssets/Plugins/Editor/JetBrains* .vs/ .gradle/ ExportedObj/ .consulo/ *.csproj *.unityproj *.sln *.suo *.tmp *.user *.userprefs *.pidb *.booproj *.svd *.pdb *.mdb *.opendb *.VC.db *.pidb.meta *.pdb.meta *.mdb.meta sysinfo.txt *.apk *.aab *.unitypackage crashlytics-build.properties /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* /[Aa]ssets/[Ss]treamingAssets/aa.meta /[Aa]ssets/[Ss]treamingAssets/aa/*``` – AntonioSaintPierre Jun 09 '21 at 18:28
  • sorry if this is not the right way to do it. this is my first question here and i'm not sure how everything works yet – AntonioSaintPierre Jun 09 '21 at 18:28
  • @AntonioSaintPierre hm looks fine actually .. did you add this afterwards? In that case maybe this helps [How to make Git "forget" about a file that was tracked but is now in .gitignore?](https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore) – derHugo Jun 09 '21 at 18:55