Legacy Documentation: Version 2018.2 (Go to current version)
Reverting files
Excluding Assets from publishing to Collaborate
Other Versions

Resolving file conflicts

A conflict occurs when another team member makes changes to an AssetAny media or data that can be used in your game or Project. An asset may come from a file created outside of Unity, such as a 3D model, an audio file or an image. You can also create some asset types in Unity, such as an Animator Controller, an Audio Mixer or a Render Texture. More info
See in Glossary
that you have also changed, and you try to update your Project with those changes. Collaborate automatically attempts to merge files and informs you if the attempt fails due to a conflict. For text files, Collaborate merges files using the currently configured merge tool. For ScenesA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
and other files using the YAML format, Collaborate uses Unity’s Smart Merge tool to perform the merge.

You can reduce the occurrence of conflicts by publishing small changes often, and communicating with your teammates. The In-Progress feature can help you reduce conflicts on scenes and prefabsAn asset type that allows you to store a GameObject complete with components and properties. The prefab acts as a template from which you can create new object instances in the scene. More info
See in Glossary
. For more information, see In-Progress edit notifications.

Configure your merge tool

You can set your external merge tool in the preference settings of the Unity Editor:

  1. On the Editor menu bar, select Edit > Preferences.
  2. Click External Tools and, from the Revision Control Diff/Merge drop-down menu, select an external merge tool.

The following merge tools work well with Collaborate:

  • Apple File Merge
  • WinMerge
  • Beyond Compare 4
  • SourceGear DiffMerge
  • TkDiff

You might experience issues using other external merge tools.

Working with conflicts

After merging files, if there are any Assets with conflicts, Unity displays a red warning icon on the Collab button in the Editor toolbarA row of buttons and basic controls at the top of the Unity Editor that allows you to interact with the Editor in various ways (e.g. scaling, translation). More info
See in Glossary
. To view a list of Assets with conflicts, click the Collab button.

When you hover over an Asset in the list, the conflicts dialog shows four actions for each Asset with a conflict. You can:

  • See differences, to view the conflicting changes.
  • Launch external tool, to open an external merge tool.
  • Choose mine, to publish your changes, overwriting the currently saved version of the Asset .
  • Choose theirs, to delete your changes and use the version of the Asset currently in the cloud.

To view a conflict, hover over the conflicted file and click the eye icon.

Eye icon
Eye icon

Note: You can view changes of prefabs, scriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info
See in Glossary
, and all binary files; however you cannot view changes to image files such as .pngs.

You can use an external merge tool to resolve conflicts on prefabs, scripts, and other text-based files. To resolve the conflict using an external merge tool, click the double-up arrow.

Double up arrow
Double up arrow

To replace the version of the Asset in the cloud with your version of the Asset, click the single up arrow.

Up arrow
Up arrow

To discard your version of the Asset and apply the version in the cloud to your local project, click the down arrow.

Down arrow
Down arrow

• 2017–05–16 Page amended with no editorial review

对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答