A branch is a copy of the keys and translations of a project. Use one when you want to translate something without touching the live texts: a new feature, a campaign, a redesign. Every project starts with a protected main branch, which is what your product ships from.
How a branch works #
- Creating a branch copies everything from its base branch: the keys, source texts, translations (with their status), notes and links. After that the two live their own life.
- Working on a branch is the same as working on
main: translate, review and import. Changes stay on the branch. - Merging applies the branch to its base branch and removes the branch.
- Deleting removes the branch and everything on it.
static/screenshots/branches-page.pngCreate a branch #
- Open Branches in the navigation and choose New branch, or use the branch menu in the editor (Create new branch).
- Pick the Project.
- Enter a Branch name, for example
feature/checkout-redesign. The app turns the name into lowercase, replaces other characters with hyphens, and shows the result in the Preview. Letters, numbers,.,_,-and/are allowed, and a name is at most 60 characters. - Pick the Base branch (
mainby default). - Choose Create branch.
You need the reviewer role or higher. A branch name must be unique within the project.
Branches are also created for you: when you push from the CLI or a connected repository on a Git branch other than the default branch, a branch with the same name is created from main. See GitHub.
Merge a branch #
A branch can be merged when it is Ready to merge: every key that has a source text is approved in every language of the project. Open the branch’s menu on the Branches page and choose Merge into main. The branch always merges into the branch it was created from. You need the manager role.
What the merge does to the base branch:
- Keys of the branch are added, and keys that exist on both get the source text and description of the branch.
- Every translation of the branch that is not empty replaces the translation of the same key and language on the base branch, together with its status.
- Keys that you deleted on the branch are not deleted from the base branch, and notes and links are not copied back.
- The branch is deleted afterwards. Entries it added to the translation memory move to the base branch.
A merge does not detect conflicts. If the same translation changed on both branches, the version from the merged branch wins. Keep branches short-lived and merge often.
When the translations on the branch were all reviewed, the Review page offers a Merge branch shortcut to the Branches page.
Freeze a branch #
A frozen branch is read only: translators cannot save, submit or add keys, and pushes to it are refused. Freeze a branch from its menu when its content must stay as it is, and choose Unfreeze to continue. You need the manager role. To freeze the whole project, see Workflow.
Delete a branch #
Choose Delete branch from the branch’s menu and confirm.
Deleting a branch is permanent. Translations on the branch that were not merged are lost. Merge or export first.
The protected branch (main) cannot be frozen, merged or deleted.
Git branches and merged pull requests #
If a repository is connected, merging a pull request (GitHub) or merge request (GitLab) into the default branch merges the branch with the same name for you. You can also run ct merge <branch> from a pipeline. See GitHub, GitLab and the CLI commands.