Ways to Avoid conflict between prefabs in source control

I am trying to avoid the conflict between prefabs using source control, such as in branches merge or even other team member are using the same prefab, how to avoid that? or solve conflict without loosing our changes?. So any Idea.

This is what I learned from using Unity at Game Jams, and this goes for scenes as well as prefabs.

  • Create all the elements Separately, create your own prefab/scene or copy of the prefab/scene and test your part.
  • Have a designated “combiner”, this person puts all the final things together. This really helps when building a scene, since conflicts in scenes aren’t easy to fix.
  • Use specific GIT-IGNORE files: See this: How to Git with Unity

Merging Unity assets (be it prefabs or scenes) is not very straight forward and often doesn’t work as it should, so I would avoid it whenever possible.

An easy way to do that is to communicate on who is editing a prefab/scene in any given moment. You cannot start your work on an object without communicating that and after you are finished you push immediately. If you failed some steps and you have conflicts then sorry, but you should take other persons work and redo yours (or take a gamble with merge, but I am paranoid and never do that).

I work in a small team on a small project so it’s easy to keep track on things on Discord, but for more complex scenarios I would probably make a spreadsheet to mark which assets are currently in use. I believe there are even version control systems (Perforce if I’m not mistaken) that enforce this kind of workflow. So to start work on something you have to first claim it in the version control. Nobody else can work on a claimed asset and this state is automatically updated in real time