Name

gx - A tool that syncs a directory in a Git repository with another Git repository.

Synopsis

gx [--help] [--version] [COMMAND]

Description

A tool that syncs a directory in a Git repository with another Git repository.

Directories, synced with external repositories, are called X-Modules. To create an X-Module, use gx add-module command. It creates an X-Module inside the tree of the parent Git repository.

For example, you can insert http://example.com/repos/mylibrary.git as 'contrib/mylibrary' directory of your parent Git repository. This directory will be kept in sync with the original Git repository.

To synchronize X-Modules with their corresponding repositories, run gx sync. It is recommended to set this command as a cron job / sсheduled task, to keep X-Modules in sync with external Git repositories.

To see the list of all X-Modules on a branch, run gx status.

To delete X-Modules from the tree, run gx delete-module.

Every 'git push' to the parent Git repository is handled by a special pre-receive hook that is installed with the gx add-module call. This hook runs gx sync command internally. You can manually uninstall or install back this hook using gx uninstall and gx install commands respectively. Usually one doesn’t need to run these commands explicitly, so they are not listed in the console docs.

To see, how gx can be used in real life, run

$ gx demo --scenario product-repo demo

OR

$ gx demo --scenario split-monorepo demo

For more detailed versions of these demos, run

$ gx demo --repos-only --scenario product-repo demo

OR

$ gx demo --repos-only --scenario split-monorepo demo

and follow the instructions.

Options

--help

display detailed help message

--version

display version info

Commands

add-module

Add an external Git repository as an X-Module to the parent Git repository.

delete-module

Delete an X-Module at the specified path.

status, st

List all X-Modules in the repository and their sync statuses.

sync

Sync all configured X-Modules with external repositories.

demo

Create demo repositories with X-Modules to show and test the functionality.

help

Displays help information about the specified command