Git Connector Commands

To get command-line help:

gconn --help > gconn_help.txt

Command usage:

gconn command [options...] [arguments...]

Prerequisites

Set the environment variable GCONN_CONFIG to the absolute path of the gconn.conf file by issuing this command:

export GCONN_CONFIG=/opt/perforce/git-connector/gconn.conf

Options

Options

-h | --help

Show this help message.

-V | --version

Show version and copyright infomation.

-M | --mirrorhooks [-n] [args]

Add/remove/list mirrored repos.

arguments  

add

Add new mirrored repo to Helix. To mirror repos with restricted access, supply access token or credentials in mirror URL.

remove

Disable mirroring for an existing mirrored Helix repo.

list

List all mirrored repos in Helix.

setremote

Change the remote url for a repo or set of repos mirrored by a Gconn instance. The first argument is matched against the remote url for all repos mirrored by this Gconn instance. The second argument replaces the first argument in the remote url for all matched repos. This allows upating the remote url for a specific repo or for a set of repos matching the first argument pattern.

-n

Dry run - only supported by 'setremote'.

fetch

Update the mirror by fetching from the configured upstream_url.

examples

--mirrorhooks add repo/repoA http://github.com/my/repo

--mirrorhooks add repo/repoB http://gitlab-ci-token:[email protected]/my/secret/repo

--mirrorhooks remove repo/repoA

--mirrorhooks setremote http://github.com http://gitlab.com

--mirrorhooks setremote http://github.com/my/repoa http://gitlab.com/your/repob

--mirrorhooks setremote http://github.com/my/repoa http://user:[email protected]/your/repob

--mirrorhooks fetch repo/repoA --mirrorhooks list

Commands

sync-ssh-keys

Force update of p4 pubkeys from Helix.
This command must be run from OS account of the user
used for SSH authentication (usually 'git').

poll-repos

Update graph repos from the Helix Central Server.
This command will apply updates from Helix to each repo
specified in a comma or space delimited list as the value in the
UpdateCachedRepos: field of a Gconn instance's server spec.
The server name of each GitConnector is recorded in the GCONN_CONFIG
file under the gconn.serverId field.
The repo cache directory does need not exist.