Update from the main branch
Abstract allows designers to work in the same projects or files in parallel by using branches. Since you and your teammates work on your own tasks at your own pace, each branch has a different timeline and has to go through the merge process. When you’re working on designs in your branch in Abstract, you may notice that sometimes the Merge Branch button is replaced by a button that says Update from Main… (or Update from Parent... if you’re working in a child branch). This means that you or someone on your team has merged a branch to the main branch and your branch now differs from the main branch. Pull their changes into your branch by updating from the main branch.
What is a merge conflict?
Clicking the Update from Main… button begins the process of comparing the files in your branch to the files in the main branch. Sometimes this process doesn't result in conflicts, which means that you and the teammate who merged their branch did not have any overlapping work. When you do encounter a conflict, this usually means that your colleague updated some artboards in the main branch and you also updated those same artboards in your branch. Abstract surfaces these differences so that you can choose what changes to keep and what changes to discard in your branch.
For example, let’s say the main branch (in the case below, it’s a parent branch) contains artboards with designs at the hi-fidelity stage. Your branch, on the other hand, has those same artboards still in the wireframe stage but with updated copywriting.
To complete the update to your branch, decide which artboards you’d like to keep - the wireframes or the hi-fidelity designs. You can choose to resolve conflicts one-by-one or in batches.
What causes a merge conflict?
The most obvious action that creates a merge conflict in Abstract is when two or more designers work on the same artboard in the same file. These are visual changes that you can see when you compare designs.
Visual changes that could cause a merge conflict include:
An artboard or item on an artboard was resized.
A layer in an artboard was removed, added, moved, resized, or updated.
A text style or layer style was added or removed from an item in an artboard.
A symbol was overridden with a different text value, text style, layer style, inserted image, or nested symbol.
A shared element (symbol, layer style, or text style) local to the document was updated.
A shared element from a linked library was updated.
An artboard was added or removed.
There is also a lot of data inside a design file that can be altered while you are working, and these changes can lead to conflicts even if it looks like nothing was changed. We call these non-visual changes and they can be difficult to notice.
Non-visual changes that could cause a merge conflict include:
- A file was added, removed, renamed, or updated to a different version.
- A page in a file was added, removed, renamed, or reordered.
- An artboard, or a layer inside an artboard, was renamed.
- An artboard was moved to a different part of the canvas or moved to another page in the file.
- A layer style or text style was added, removed, renamed, or changed.
- A Sketch prototyping hotspot was added, removed, or changed.
- Resizing settings (pinning and fixing) were added, removed, or changed on an item.
- One or more layouts, grids, or rule lines were added, removed, or changed.
- A symbol was overridden or changed and a library update was accepted.
Avoiding merge conflicts
Regardless of how carefully you work, conflicts happen, even in the world of engineering. Some tips on how to avoid merge conflicts in the first place:
- Don’t open or change a file unless you need to because the odds of running into conflicts at merge are higher if you’ve impacted too many files, especially ones others might be working on.
- Try not to delete anything (artboards, pages, files) on the parent branch until child branches are merged.
- Be aware of the list of non-visual changes so that you can keep track of the other aspects of a file that you or a teammate may have altered.
- When updating your branch from the main branch, only choose your artboard when you know you made a change on that artboard. Embrace it as a moment of reflection on the work done.
- Be discerning when updating from the main branch. You are responsible for the merge, so if you pull in work you didn't do, you are now accountable for that work.