Conflicts sometimes happen when multiple users edit the same model. For example, let's say you
User model with the following properties:
- username: string
- name: string
Now you decided to remove the name property and replace it with firstName and lastName properties. Good, but wait... You got a conflict message as you tried to commit the changes!
What happened? It turns out your ally John meanwhile committed a change where he made
the name field optional. OneGen now doesn't know what to do with this collision and yields
a conflict in the
Once you close the commit dialog, you'll see an editor open up, showing you the conflicts in the Genesis language as shown in the screenshot below. You might want to read a bit about Genesis before continuing.
The conflict resolution view breaks down to:
- The list of conflicted files in the left sidebar
- The code editor
Resolving a Conflict
Every conflict is highlighted by the lower/greater/equal signs splitting up a code into 2 versions. This probably looks familiar to you since you use Git.
- Their version: This is the version that is currently committed (John's version in our example).
- Our version: This is our version that caused the conflict and cannot be committed until we resolve this conflict.
As you can see, we have to read between the lines 🤭 to resolve this conflict. We decided to remove the name property and replace it with firstName and lastName, so we can actually delete John's minor change. We simply delete the Their version chunk of code and just leave our version in place. The solution should look like the screenshot below.
Now we can hit the Resolve Conflicts button on top right. This action will commit the conflict resolution and redirect us back to the project. If John was to open the project now, he would see the new firstName and lastName properties.
If you ever get uncertain about the conflict resolution, you can click on the Reset Changes button. This action will reset all the changes you've done in this view so far.