0

Im working with unity, and I have a main computer pushing changes that are then pulled by a secondary computer, to keep the projects synced. The secondary computer is not supposed to make any changes, only receive them.

The only problem is that whenever i go to pull on my second pc, it wants me to stash about 73,000 changes, which takes about 5 minutes to do.

How can i prevent sourcetree from detecting these changes so i dont have to stash them, or is there a better solution to this problem?

Leon Hogan
  • 11
  • 1
  • Are you checking in files that are build products? If so, that's likely your problem. – bk2204 Nov 01 '21 at 00:32
  • 1
    Make sure you are using a proper .gitignore file for Unity projects. Here's an example: https://github.com/github/gitignore/blob/master/Unity.gitignore If you have not excluded the Library directory in particular you'll have nothing but trouble. `git reset --hard && git clean -fxd` will remove any changes in the local repo and then pulling should be fine. – Retired Ninja Nov 01 '21 at 01:21
  • I am using the reccomended unity .gitignore, but that doesnt seem to work, even though i have it in both the repository directory and the unity project directory. Yet github desktop still tries to include changes to library and temp in the commit. – Leon Hogan Nov 01 '21 at 04:48
  • 1
    @LeonHogan https://stackoverflow.com/a/1274447/7976758 – phd Nov 01 '21 at 08:43
  • "both the repository directory and the project directory" suggests your folder structure is incompatible with the unity ```.gitignore```. That gitignore expects the repo TLD to be the project folder. (eg, "Project Name/.git" folder sibling to "Project Name/Assets" folder) – Immersive Nov 03 '21 at 06:59

1 Answers1

0

Thanks for all the answers. I had the recommended unity .gitignore file, however it was placed one folder too high. The .gitignore file MUST be located alongside the Asset and Library folders for it to work.

Leon Hogan
  • 11
  • 1