GitHub or GitLab HTTP
- The target repo must NOT already exist in Helix Core Server.
- The source repo must not be empty.
If the repo is private or internal, consider creating a personal access token:
- For GitHub - Creating a personal access token for the command line - https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
- For GitLab - Personal access tokens - https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html
On the Git Connector server
-
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 togit
by default, but you can specify a different user name in the--sshuser
parameter.) -
Configure the webhook for mirroring:
TipCopy the URL from your project's HTTP drop-down box.
- Set the environment variable
GCONN_CONFIG
to the absolute path to thegconn.conf
file:export GCONN_CONFIG=/opt/perforce/git-connector/gconn.conf
- 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.
WarningMake sure you use the URL to create the mirror hook. Do not create a mirror hook by using an IP address.
- Set the environment variable
-
Save the secret token that the
--mirrorhooks
command generates, which is not related to the personal access token for GitHub or GitLab.TipThe secret token is also stored in
/opt/perforce/git-connector/repos/graphDepotName/repoName.git/.mirror.config
Mirror a repo over HTTP
-
Go to the hooks URL, which might resemble
https://GitHost/project/repo/hooks
and represents the web hook URL for your Git client:- For GitLab see https://docs.gitlab.com/ce/user/project/integrations/webhooks.html
- For GitHub, see https://developer.github.com/webhooks/creating/
-
Paste the URL of the Git Connector into the URL text box:
https://GitConnector.com/mirrorhooks
-
Paste the webhook secret token in the Secret Token text box.
-
Uncheck Enable SSL verification.
-
Select events to trigger the webhook and click Add Webhook.
-
Click the lower right corner Test button to validate the web hook is correctly set up.