1 Unity Collaborate

1.1 Get Started With an Existing Project

  1. Open Unity Hub

  2. Sign into your unity account

  3. Under the Projects tab you should see the shared project in grey. To download it select the unity version and click the cloud download button icon.

Note

If you do not see a shared project sometimes you first have to hit the refresh button located below the last project in the list. If the button does not exist that means it has already refreshed. To refresh it again simply close and open unity hub. If you still cannot find the project that may mean that the owner of the project has yet to share it with you. It is possible that even if the owner of the project added you to the Unity group they did not specifically add you to the project within the group. Follow this forum thread for more details

1.2 Collaborate in the Unity Editor

1.2.1 Collaborate Window

Inside the Unity Editor select Window -> Collaborate to open the collaboration window.

1.2.2 Sync with Changes from a Teammate

Whenever a teammate updates some of their files, a “Sync” button will appear in the collaborate window. Click on that button to update your project with their changes.

1.2.3 Push Your Changes

Inside the collaborate window you can look over all of your changes. Select the ones you want to apply, and then write a commit message in the text box below. Finally click the “Publish” button to push your changes to the rest of the team.

1.2.4 Debugging Merge Conflicts

Sometimes you may accidentally modify the same files as your teammates. When this happen and you click the “Sync” button in the collaborate window, unity will present an error message saying that conflicts were detected. To debug these conflicts do the following:

  • If you have not set any Diff/Merge tools:

    1. Go to Edit -> Preferences

    2. Under the “External Tools” tab you should see an comment saying something like

      No supported VCS diff tools were found ...
      
    3. I chose to install SourceGear DiffMerge which was the first diff tools that was reccommended by Unity. You can download it from the DiffMerge donwload page.

    4. After downloading the installer, launch it and follow the steps in the installation window. By default the executable will be installed in ProgramFiles/SourceGear/Common/sgdm.exe

    5. Next we go back to Unity and go to Edit -> Preferences

    6. Under the “External tools” tab go to the “Revision Control Diff/Merge” dropdown and select “SourceGear DiffMerge”.

      Note

      If the “SourceGear DiffMerge” option does not exist, refresh the unity editor by closing and re-opening it.

  • If you have Diff/Merge tools installed:

    1. Open the Collaborate Window (Window -> Collaborate)

    2. Next to the files with differences click the eye icon. The differences should appear using your Diff/Merge tool of choice. Here you can view the differences but you will not be able to resolve the merge conflicts here as it is a read only view.

    3. If you click on the merge icon (arrow with two tails) You will open your Diff/Merge tool with the ability to resolve the merge conflict and edit the file directly.

    4. Often when are dealing with prefabs the conflicts will be very difficult to resolve through text editing alone. therefore you have 2 other options.

      • Use My Changes: The “arrow pointing up into a line” icon is used to accept your own changes.

      • Use Remote Changes: The “arrow pointing down into a line” icon is used to accept the remote’s changes.