Merging — Part 3

1: Update from Master
2: Resolve merge conflicts
3: Cleaning up your branch — you’re here 📍

Now you’ve completed the update branch flow and you’ve brought in changes from master or the parent branch. However, your files might not be in a state to be merged to master yet – or you might still have work to do on your branch. Here are some tips on how to clean up your branch based on which workflow you went with.

Clean up your branch with duplicated artboards

If you used the method mentioned in step 2 of duplicating artboards to bring in the updates from master while also keeping the designs in your branch, you’ll have some clean-up work to do to make sure that the end result of merging is organized and polished.

  1. Open up the file(s) that had merge conflicts. 
  2. For each duplicated artboard, copy and paste the items you want to keep from the duplicate to the original artboard. It is important to keep the original artboard in order to maintain the history of master. This will also help prevent collections from being rendered with missing previews.
  3. When you’ve consolidated all of the changes that you wanted to keep onto the original artboards, delete the duplicates.
  4. Save and make a 🧽clean-up commit.

Get back work from a previous commit

You may have decided to accept all or most of the changes on the master or parent branch, overwriting your current branch’s progress. To prepare your file for merging, you’ll likely need to bring back some of the work that was overwritten.

  1. In your branch, go to the commits tab.
  2. Find a previous commit from before the update from master commit you just created.
  3. Click Open Untracked to open a copy of the file from that commit.
  4. Copy and paste the items you want to keep from the untracked file into the current file.
  5. If there were any symbols copied over from the older file, make sure that they are still linked correctly in the current file.
  6. Repeat steps 3-5 for each file that you had been working on in your branch.
  7. When you’ve updated all of the artboards that you intend to keep, you can close out the untracked file(s).
  8. Save and make a 🧽clean-up commit.

Bring in select changes from master

Similarly to the above workflow, you may have instead selected to keep all of the work on your current branch. While this allows you to continue working in your branch without having to go get your work back, it also means that when you merge to master you’ll overwrite the artboards where there were conflicts.

You can still bring in select artboards from master (or a parent branch) by following these steps.

  1. Go to master (or the parent branch) from which you updated.
  2. Right-click to Open Untracked or click the Edit in Sketch button and select the open untracked option.
  3. Copy and paste the items you want to bring in from the untracked master file into the current file.
  4. If there were any symbols copied over from the master or parent branch file, make sure that they are still linked correctly in the current file.
  5. Repeat steps 2-4 for each file that you had been working on in your branch.
  6. When you’ve brought in all of the changes that you need, you can close out the untracked file(s).
  7. Save and make a 🧽clean-up commit.

Be careful about restoring commits after updating from master. After you click Update from Master… or Update from Parent… and go through the conflict resolution workflow, you’ve essentially told Abstract that there are no more conflicts between your branch and master, and you are able to merge your branch when you want.

If you need to clean up your files or you discover that you should have selected the artboard(s) from master but you had actually selected the ones in your branch, it can be tempting to
restore to a prior commit. The risk here is that when you restore to a commit from before the update, you won’t get the Update from Master... button again, and you may end up overwriting all of the changes in the parent. Instead, you should use the steps outlined above to open the needed file(s) untracked and keep moving forward to fix your branch.