GitHub or GitLab HTTP

Important
  • The target repo must NOT already exist in Helix Server.
  • The source repo must not be empty.
Tip

If the repo is private or internal, consider creating a personal access token:

On the Git Connector server

  1. Log in as the GitConnector SSH system user or the user you specified when configuring the Git Connector. (The GitConnector configuration script, configure-git-connector.sh, sets the user name to git by default, but you can specify a different user name in the --sshuser parameter.)

  2. Configure the webhook for mirroring:

    Tip

    Copy the URL from your project's HTTP drop-down box.

    1. Set the environment variable GCONN_CONFIG to the absolute path to the gconn.conf file:

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

    2. Add the web hook:

      gconn --mirrorhooks add graphDepotName/repoName https://access-token:secret@GitHost.com/project/repoName.git

      where access-token:secret represents your personal access token for GitHub or GitLab.

      Warning

      Make sure you use the URL to create the mirror hook. Do not create a mirror hook by using an IP address.

  3. Save the secret token that the --mirrorhooks command generates, which is not related to the personal access token for GitHub or GitLab.

    Tip

    The secret token is also stored in /opt/perforce/git-connector/repos/graphDepotName/repoName.git/.mirror.config

Mirror a repo over HTTP

  1. Go to the hooks URL, which might resemble https://GitHost/project/repo/hooks and represents the web hook URL for your Git client:

  2. Paste the URL of the Git Connector into the URL text box: https://GitConnector.com/mirrorhooks

  3. Paste the webhook secret token in the Secret Token text box.

  4. Uncheck Enable SSL verification.

  5. Click Add Webhook.

  6. Click the lower right corner Test button to validate the web hook is correctly set up.