- Home /
Merge Conflicts - Bitbucket, Sourcetree. How do I get around this?
Have been working on a project in Unity with a friend and the friend created his own branch called Danny'sBranch.
Changes were made in the Master's branch while Danny worked on Danny's branch. I tried to merge the branches. The Unity project itself seems to have stuff from both branches but there are a lot of errors.
The errors from sourcetree are the following:
git -c diff.mnemonicprefix=false -c core.quotepath=false merge origin/DannysBranch Auto-merging marble-action-now.userprefs CONFLICT (content): Merge conflict in marble-action-now.userprefs Auto-merging Library/metadata/92/92e6676b2a6c31945a7cf6b6ac40ca57 CONFLICT (content): Merge conflict in Library/metadata/92/92e6676b2a6c31945a7cf6b6ac40ca57 Removing Assets/TARGET.obj.meta Auto-merging Assets/Scripts/GameManager.cs CONFLICT (content): Merge conflict in Assets/Scripts/GameManager.cs Auto-merging Assets/Scenes/Scene1.unity CONFLICT (content): Merge conflict in Assets/Scenes/Scene1.unity Auto-merging Assets/Prefabs/PC 1.prefab CONFLICT (content): Merge conflict in Assets/Prefabs/PC 1.prefab Auto-merging Assembly-CSharp.csproj Automatic merge failed; fix conflicts and then commit the result. warning: Cannot merge binary files: Library/metadata/92/92e6676b2a6c31945a7cf6b6ac40ca57 (HEAD vs. origin/DannysBranch) warning: Cannot merge binary files: Assets/Scenes/Scene1.unity (HEAD vs. origin/DannysBranch) warning: Cannot merge binary files: Assets/Prefabs/PC 1.prefab (HEAD vs. origin/DannysBranch)
The main question would be, what should we do to fix this problem?
Thanks.
Answer by MrMatthias · Jan 03, 2019 at 01:22 PM
You need to setup your project for version control. Read: https://docs.unity3d.com/Manual/VersionControl.html The important parts are Asset Serialization set to "force text", Version Control mode set to "Visible meta files" and Smart Merge. You find more on Smart merge and conflicts here: https://support.unity3d.com/hc/en-us/articles/207332543-What-are-the-solutions-to-scene-prefab-conflict-merging- There still might be conflicts though that you have to merge manually. To do this you have to know the YAML Format: https://docs.unity3d.com/Manual/TextSceneFormat.html Don't check in Library files, you can simply setup a git ignore file to ignore this and other folders: https://github.com/github/gitignore/blob/master/Unity.gitignore
Your answer
Follow this Question
Related Questions
Light map effect on mesh merge 1 Answer
Is there a way to merge duplicate materials and textures 1 Answer
Git merging trouble 0 Answers