Git sync allows users to update their local repositories in Stronghold with both public and private remote repositories through the transfer server. After creating a remote repository and uploading code to it, the user can clone it to their Stronghold environment and automatically have future changes pulled to their local repo. Here's how it works:
Create a "newrepo" file with information about your repository
Copy the "newrepo" file to the transfer server of your tenant
Clone the repo from transfer server
Please note that the repo is cloned to your current directory and is public to anyone with access to the directory
Pull most recent commits
Create a text file named "newrepo" without a file extension on your computer or in your stronghold workstation. This file should be a single line with two parameters: the name of your repo and a Git URL (https:// or ssh://).
<repo name> <git url>
The repo file should be uploaded to the transfer server using the instructions found in the SFTP Data Transfers documentation. The transfer server will download the public repo and perform a virus scan on each file in the repo.
NOTE: It may take 15+ minutes for the repo on the transfer server to sync with the external repo.
On the Stronghold workstation, navigate to the directory you want to clone the repo into and git clone from the transfer server. The URL should be formatted with “git://”
git clone git://<tenant>-xfer.stronghold.brown.edu/<repo name>
Where <tenant>
is your Stronghold tenant and <repo name>
is the same value as the first parameter in the "newrepo" file you made.
You can pull new commits by navigating to the repo on your stronghold workstation and doing a git pull
.
NOTE: It may take 15+ minutes for the repo on the transfer server to sync with the external repo.
Create a text file that contains ONLY the private key for your private repo. The name of this file can be whatever you wish because the "newrepo" file will specify this file name.
Create a text file named "newrepo" without a file extension on your computer or in your stronghold workstation. This file should be a single line with three parameters: the name of your repo, a Git URL (ssh://), and the name of the private key file you made in the previous step.
<repo name> <git url> <private key name>
The private key file should be uploaded to the transfer server using the instructions found in the SFTP Data Transfers documentation.
The repo file should now be uploaded to the transfer server using the instructions found in the SFTP Data Transfers documentation. The transfer server will download the private repo and perform a virus scan on each file in the repo.
NOTE: It may take 15+ minutes for the repo on the transfer server to sync with the external repo.
On the Stronghold workstation, navigate to the directory you want to clone the repo into and git clone from the transfer server. The URL should be formatted with “git://”
git clone git://<tenant>-xfer.stronghold.brown.edu/<repo name>
Where <tenant>
is your Stronghold tenant and <repo name>
is the same value as the first parameter in the "newrepo" file you made.
You can pull new commits by navigating to the repo on your stronghold workstation and doing a git pull
.
NOTE: It may take 15+ minutes for the repo on the transfer server to sync with the external repo.