# Apple File Merge # Almost did not work at the time of writing, so I advise you to comment and use DiffMerge #* use "/usr/bin/opendiff" %r %l -ancestor %b -merge %d # Beyond Compare Prefab use "%programs%\YouFallbackMergeToolForPrefabsHere.exe" "%l" "%r" "%b" "%d" # Default fallbacks for unknown files. Unity use "%programs%\YouFallbackMergeToolForScenesHere.exe" "%l" "%r" "%b" "%d" # %l is replaced with the path of you local version # %r is replaced with the path of the incoming remote version # %b is replaced with the common base version # %d is replaced with a path where the result should be written to # On Windows %programs% is replaced with "C:\Program Files" and "C:\Program Files (x86)" there by resulting in two entries to try out # On OSX %programs% is replaced with "/Applications" and "$HOME/Applications" thereby resulting in two entries to try out # UnityYAMLMerge fallback file # Modify the next two lines if scene or prefab files should fallback # on other that the default fallbacks listed below. So if you encounter problems on macOs, be sure to comment out opendiff and configure the alternative. P4Merge ( Perforce merge) also works, but not quite stable. It started up immediately out of the box, apparently because it is one of the tested tools. In the end, the most working solution was DiffMerge, included in mergespecfile.txt by default. Some refuse to work according to the scheme proposed by UnityYAMLMerge some need additional libraries. Other tools, such as VSCode, Atom, Rider from Jet Brains, Sublime Text, Sublime-Merge, KDiff3, or Diffuse, did not work for various reasons. Even if it pretended that everything was fine, in practice, when you change the initial values, the merge brokes. This article was written under the macOs, and I couldn’t get to work the standard opendiff( FileMerge) merge tool normally. It is responsible for the merge tool, which will be used as a fallback if there is a conflict of parameters that cannot be solved by the main tool. Near the UnityYAMLMerge executable, you can find the mergespecfile.txt file. It is also necessary to configure the work of standard merge tools, and this is where the main difficulties begin =) Git config -add '/Unity.app/Contents/Tools/UnityYAMLMerge merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED"' # For Windows # git config -add 'C:\Program Files (x86)\Unity\Editor\Data\Tools\UnityYAMLMerge.exe merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED"' Git config -add false # For macOs # - path to the current location of the Unity editor # Do not trusts to exit code of UnityYAMLMerge Git config -add merge.tool unityyamlmerge So, to disable their generation, use the setting: And in general, you can always rollback the merge without using this file. orig, which happen to secure the process, but you definitely do not need to store it further. Also, for parameter conflicts, we need a tool with three-way merge capabilities called through mergespecfile.txt.Īll settings will be performed on local repositories, as they are specific to Unity, and their global setup may affect working with other types of projects.Īfter resolving the conflict, git creates files containing the original data, *. To resolve object conflicts, we will additionally need to configure UnityYAMLMerge as a git mergetool. The article "Unity and git" provides the initial git configuration necessary to start any project. Parameter conflicts, not resolved after the first stage, fixed by default git tools.Objects combined on the scene with UnityYAMLMerge, so you can use an editor to resolve it.Respectively, their solution divided into two stages: We can divide such conflicts in Unity into two constituent: conflicts of objects and conflicts of parameters. Still, it is a bit concise and does not focus on the essential aspects of its use, which we will analyze in detail. Documentation provides all the necessary information on using the tool. To resolve conflicts with scenes and prefabs, Unity offers to use a utility called UnityYAMLMerge. In Unity, this problem is fully applicable to the scenes and prefabs. In the previous article, "Custom Elements in the Unity Editor,“ we briefly mentioned the problems that may arise when using all sorts of visual editors in a distributed manner, such as blueprints in Unreal. Since I did not manage to commit before my comrade, it’s time to fulfill the promise given in the article about configuring git to work with Unity and figure out how to use UnityYAMLMerge to resolve the conflicts.
0 Comments
Leave a Reply. |