On this page:

Creating Branches

Branches can be created from every page from within the actions menu if branching is not disabled by the space admin or restricted to specific users or groups (see restrictions). You need to have the permissions to create and edit pages in the space where the page-to-be-branched is located.

Additionally, if you're on a page that already has some branches, you can create a branch from the page branching dialog.

If you don't have the necessary permissions to create a branch, you will still be able to see the 'Create Branch' button but it will be grayed out. Clicking it will give information on what is going on.

Viewing Diffs

Since v1.3.0, you can look at a diff view between your branch and the original page while you are working on a branch:

The diff will show the changes in the branch categorized by added/deleted/changed:

Merging Branches

To merge a branch back into the original page either use the 'Merge' link from within the actions menu or click on the original page name in the branch info text to open a dialog where you can click the Merge button. In order to do this you need to have the permissions to view the original page, as well as edit the branched page and original page. If archiving is active, you also need to have the permission to create pages in the space where merged pages are archived to. If archiving is not active, you also need to have the permission to delete the branched page. If you aren't allowed to merge a branch due to missing permissions, you won't see the 'Merge' button.

If you don't have the necessary permissions to merge a branch, the button will be grayed out and clicking it will provide additional information.

Updating Branches

If the content of the original page has been modified, the branch can be updated to adopt these changes. Click on the original page name in the branch info text to open a dialog and click the 'Update' button. In order to do this you need to have the permission to view and edit the branch as well as view the original page. It is recommended to update branches before merging them, indicated by the colors of the buttons.

If you don't have the necessary permissions to update the page, the button will be grayed out. Clicking it will provide additional information.

Deleting Branches

Since branches are pages in Confluence, they can be deleted via the regular delete link in the Actions Menu:

Since v1.3.0, there is also a quick link to delete a branch in the Page Branching dialog:

Restricting Viewing Or Editing Branches

To restrict branches from either being viewed entirely or being edited, use the Confluence restrictions dialog like on any other page.

Since version 1.2.0 there is also the option to restrict the branch to the creating user when it is created:

Restricting Who Can Create Branches

To restrict which users or groups can create branches in a space, simply add view permissions/restrictions to the 'Branches' parent page as described in the previous section. The parent page is created with the first branch in a space and can be found via the space shortcut or in the page tree directly under the home page.

Archiving Branches

Branches are moved to the trash by default when merging a branch. However, a space administrator can enable branch archiving within the Add-ons → Page Branching page in the Space Tools and configure an archive space. After that, a branch will be moved to that archive space instead of to the trash. Keep in mind that users need to have the permission to create pages in the archive space in order for them to be able to merge pages when archiving is activated.

Disabling Page Branching

A space administrator can disable Page Branching in their respective space within the Add-ons → Page Branching page in the Space Tools.

REST

Page Branching provides a REST interface in order to branch a specific page using a POST request. Further information about the endpoints will follow below:

rest/pagebranching/1.0/

The following headers need to be present for each request:

  • Content-Type: application/json
  • Authorization: Basic Auth with Confluence User (Example: Basic dXNlcjpwYXNzd29yZA==)

Branching

rest/pagebranching/1.0/branchPage

The endpoint requires the following parameters in JSON Format:

  • ID of the page that shall be branched
  • Branch name for the branched page
     
{
	"pageId" : 549027858,
	"branchName" : "My Branch"
}

If the branching has been successful, the new page ID of the branched page will be returned. In case of failure, an error message will be displayed.
Branching via the REST interface still requires Page Branching to be enabled in the corresponding space as well as an authenticated user to have all required permissions.

Merging

Page Branching also provides a REST endpoint to merge branches back into the original page:

rest/pagebranching/1.0/mergePage

The Endpoint requires the following parameters in JSON Format:

  • ID of the page that shall be merged
{
	"pageId" : 549027858
}

Merging is only possible if no merging conflicts occur. In case of successful merging, a HTTP response 200 will be sent.

Further Links


Please note that Page Branching for Confluence is incompatible with Scroll Versions for Confluence.


Download Page Branching
from the Atlassian Marketplace!