Skip to main content

Branching

Branching is a workflow concept of working on larger projects, to organize the contribution to a project and to avoid friction between team members and agents. Branches create "isolated spaces" where assets and code can be contributed to a project without intefering others. Usually, before this contribution is added to the main project, a review and approval process (so called change request in Lore) is conducted to make sure that only high quality work is contributed to the project.

Anchorpoint leans toward the concept of "trunk-based-development". This is a simple branching guideline, where any development effort is structured around one single branch (often the main branch) rather than in sub-branches of sub-branches. This does not mean that you should commit everything on main, but rather create branches out of main and merge back into main.

All branching happens in the branch overview. Open it by clicking on the branch name at the beginning of the breadcrumb bar (on the Browser, Changed files and Revisions pages) or on the branch name in the status bar at the bottom left of the application. The overview lists your Current branch at the top and all Available Branches below it. Each entry shows the branch name, the date of its latest revision and the author. Use the Filter Branches field to search for a branch by name.

How to create a new branch

  1. Open the branch overview and click on New Branch.
  2. Enter a name. You can organize branches by writing a category in front of the name, e.g. wip/layout, wip/some_level or bugfix/some_bug. Spaces are replaced with dashes.
  3. Decide what should happen with the new branch:
    • Checkout branch (enabled by default) switches to the new branch right away, so you can start working on it.
    • Publish branch also creates the branch on the Lore server, so your team members can see it. If you leave this off, the branch only exists on your computer until you push your first revision or use Publish branch from the branch overview.
  4. Click on Create.

The new branch always branches out from the branch you are currently on. The dialog tells you which one that is. If you want to branch out from main, switch to main first.

Viewing other branches

Clicking on a branch in the branch overview does not switch to it. Instead, it previews the branch: the Browser page shows the files as they are on that branch, and the Revisions page shows its history. Your working copy stays untouched, so you can look around on a branch without committing or reverting your own changes first.

While you are previewing another branch, the branch name in the breadcrumb bar turns turquoise and shows an eye icon. Committing and submitting is disabled, because you are not on that branch. To get back to your own branch, click on Reset view to current branch next to the branch name, or right click on the branch name and choose the same option.

On the Revisions page, a merge revision has a small arrow that expands the revisions that were brought in by that merge. Right clicking on a merge revision also offers View branch, which previews the branch that was merged. This only works as long as that branch has not been deleted.

Branch status icons

Each branch in the overview has a status icon. Hover over it to see what it means:

  • Published and in sync with the server — you are up to date.
  • You have local revisions that aren't pushed yet — push from the Revisions page to share them.
  • New changes on the server — pull to update — someone else pushed to this branch.
  • Local branch — publish it to share — the branch only exists on your computer.
  • On the server only — check it out to work on it — the branch exists on the server but has not been checked out on your computer yet.
  • Out of sync with the server — pull or push to catch up — your copy and the server copy differ.

Use the filter icon next to the search field to Hide local branches that have not been published.

Switching and merging branches

Switching to a branch

To actually work on a branch, hover over it in the branch overview and click on Checkout. The same command is available in the More options menu of the branch and in its right click menu. If you are currently previewing a branch on the Revisions page, there is a Checkout button in the page header as well.

Lore does not allow switching branches while you have changed files. Commit or revert your changes first, then switch. Note that selecting files on the Changed files page already marks them as staged, which also blocks switching. Unselect them or commit them.

If you are on a branch that has just been merged on the server and Anchorpoint asks you to sync, do that first. Until you sync, you cannot commit or switch.

Merging a branch into your current branch

When your work on a branch is done, switch to the branch that should receive the work (usually main) and merge the other branch into it:

  1. In the branch overview, hover over the branch you want to merge, open More options and choose Merge into current branch. On the Revisions page you can also preview the branch and click on Merge in the page header.
  2. Anchorpoint checks what the merge would do and shows how many files are modified, added, deleted or renamed, and whether Conflicts detected or No conflicts detected.
  3. Click on Merge.

The merge creates a local merge revision on your current branch. Push it from the Revisions page to get it to the server. If the branch has nothing new for you, Anchorpoint tells you that your branch already has everything from it.

If there are conflicts, the merge stays open and the Revisions page shows a Conflicting files section. Resolve every file, then click on Finish merge. You can also Cancel merge to go back to the state before the merge. See Resolving conflicts for details.

Getting new revisions from main into your branch

While you are working on a branch, your team members keep pushing to main. The Revisions page shows your branch and main as two lanes. As soon as main has revisions that your branch does not have, a Merge button appears in the page header. Hover over it to see how many new revisions it would bring in. Click on it to merge main into your branch, so you stay close to the current state of the project and keep the final merge back into main small.

If Anchorpoint tells you that a sync is required before merging, sync first. Merging on a branch that is behind the server would leave a merge that cannot be committed.

Branching commands

All of these commands are available in the branch overview. Hover over a branch to see the inline buttons, or open the More options menu or the right click menu of a branch.

View

Previews the branch without switching to it. See Viewing other branches.

Checkout

Switches your working copy to this branch. Not available for the branch you are already on, and blocked while you have changed files.

Merge into current branch

Merges this branch into the branch you are currently on. Shows a preview of the affected files and conflicts before you confirm.

Publish branch

Creates this branch on the Lore server, so team members can check it out. Only shown for branches that exist on your computer only. The branch does not need any revisions to be published. Pushing your first revision from the Revisions page publishes the branch as well.

Delete

Removes the branch. If the branch has been published, it is removed on the server as well. You are asked to confirm, because this cannot be undone from Anchorpoint. The branch you are currently on cannot be deleted, and neither can the main branch.

Reset view to current branch

Ends the preview of another branch and shows your own branch again. Available as a button next to the branch name while previewing, and in the right click menu of the branch name.

New Branch

Creates a new branch from your current branch. See How to create a new branch.

Push and sync

The Revisions page header offers Push to send your local revisions to the server and Sync to get new revisions from the server onto your branch. These commands always work on your current branch. The colored counters in the status bar show how many local revisions are waiting to be pushed and how many remote revisions are waiting to be synced.