GitHub or GitLab HTTP
- The target repo must NOT already exist in Helix 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
gitOS user or the user you specified when configuring the Git Connector. -
Configure the webhook for mirroring:
TipCopy the URL from your project's HTTP drop-down box.
- Set the environment variable
GCONN_CONFIGto the absolute path to thegconn.conffile: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.gitwhere access-token:secret represents your personal access token for GitHub or GitLab.
- Set the environment variable
-
Save the secret token that the
--mirrorhookscommand 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/hooksand 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.
-
Click Add Webhook.
-
Click the lower right corner Test button to validate the web hook is correctly set up.
Troubleshooting
If there are any issues, review the following files, or send them to Perforce Technical Support:
/opt/perforce/git-connector/repos/graphDepot/repoName.git/.mirror.config
/opt/perforce/git-connector/repos/graphDepot/repoName.git/push_log
/opt/perforce/git-connector/repos/graphDepot/repoName.git/fetch_log
/opt/perforce/git-connector/repos/graphDepot/repoName.git/.mirror.log
/opt/perforce/git-connector/gconn.conf
/opt/perforce/git-connector/logs/gconn.log
/opt/perforce/git-connector/logs/p4gc.log






