Git Synchronization Plugin

Plugin source location: <serge_root>/lib/Serge/Sync/Plugin/VCS/git.pm

This plugin provides integration with Git-based source code repositories. On pull sync step, Serge will update its local checkout from your Git server. Respectively, on push sync step, Serge will push all the updated files back to the remote repository.

Communication between Serge and Git is performed by the means of running git command-line tool. This means that Git must be installed on the same machine as Serge and have authentication properly configured.

Each configuration file in Serge represents a single translation project, and maps to one or more remote source code repositories (in case of multiple repositories, they all need to be under the same version control and have the same committer configured, since VCS plugin name and committer username are shared within a configuration file). The typical workflow is this:

  1. Create a root directory that will hold all your checkouts, e.g. /var/serge/data/
  2. Create a new Serge configuration file (let's call it my_project.serge) for your translation project so that it stores local repository files under /var/serge/data/my_project/ (see sync → vcs → data → local_path parameter)
  3. Run serge pull --initialize my_project.serge the first time to do the initial checkout; check that /var/serge/data/my_project/ folder contains proper files
  4. To test if you have proper write permissions, alter or add some file in the local repository and run serge push my_project.serge --message="test"; check that your commit went through to the remote server

Later you will run serge sync continuously against this configuration file, which will perform the two-way sync between Serge and Git among other synchronization/localization steps. See Localization Cycle for more information.

Usage

example-project.serge

The following script, if used in clone_command, is identical to the default behavior: it clones a remote repo into a target local directory. It can be a good starting point for you to experiment with custom cloning scripts.

clone-default.sh

The following script initializes LFS, enables sparse checkout, and uses an external parameter passed from the config file.

clone-monorepo.sh