Prerequisites
-
The
.phrase.yml
configuration file must be present in the root of the branch to be monitored. The file defines which files to import (pull) or export (push) from the repository. -
Read and write access are required for the repository.
-
Incorrectly defined configuration files may cause errors. Ensure that the file contains at least one push and one pull target, correct file formats and the correct setting of the
update_translations
parameter. -
Use GitLab 9.5 or newer to ensure API compatibility.
Once the configuration file is in place, to connect a repository, follow these steps:
-
From the Configure.
page, scroll down to the connector and clickThe
page opens. -
Click Add GitLab Sync.
The GitLab Sync settings window opens.
-
Select a project from the dropdown list.
GitLab Sync settings are presented.
-
Optionally select
and provide the . -
Optionally select
to import files with every commit to the selected GitLab branch. -
Select a
from the dropdown list. -
Select a
from the dropdown list to import (push) and export (pull) from. This is usually the master branch. -
Click Validate Configuration to ensure access token and configuration file are correct.
-
Click Save.
The project is now connected to the selected GitLab repository and added to the list.
To import files:
-
From the Import.
page, select a project and clickGitlab data is imported into the selected project.
To export files, follow these steps:
-
From the Export.
page, select a project and clickThe most recent files in the repository are exported as a new pull request.
-
Once files are exported, the pull request can be merged or closed in the repository and the branch can be deleted.
Gitlab Sync keeps a history of the lastest imports and exports for each Phrase project.
To view the history: