Overview
This guide provides instructions for establishing a connection with the GitLab repo for the Partner Hub. By the end, you will:
- Clone the
/partnerhub/web
repo. - Validate SSH key pair.
- Push a test commit.
After successfully pushing a test commit, you can begin contributing to the Partner Hub.
Clone the Partner Hub Repo
To begin, you need to clone the /partnerhub/web
repo. From your terminal, run the following command:
$ git clone git@git.REDACTED:/partnerhub/web.git
After cloning the repo, go to the Submit Test Commit section. If your account was provisioned correctly, you should be able to make commits without additional setup. If you are unable to make a test commit, continue to the next section to establish a key pair.
Working with GitLab and SSH keys
HBO's GitLab instance requires an SSH connection instead of the traditional HTTPS connection. The following sections provide instructions for generating an SSH key and adding it to your GitLab profile.
Gitlab's SSH Key (opens in a new tab) guideline contains more information on the commands behind key generation.
SSH key generation
To generate a new SSH key:
- Open a terminal and run:
# Use your desktop account
$ ssh-keygen -t ed25519 -C "email@example.com"
- Follow the prompts to continue (it is recommended that you enter a password for an extra layer of security).
Adding SSH key to GitLab
- To copy your SSH key, run:
$ pbcopy < ~/.ssh/id_ed25519.pub
- Navigate to SSH Keys (link has been redacted) in your GitLab User Settings.
- Paste your copied key in the text box, it should look something like this:
47:xf:71:x7:02:1x:7x:x9:9x:x3:xx:7x:xx:6x:0x:xx
. - Enter a descriptive title and click Add key.
Testing connection
To test if you correctly added an SSH key to your GitLab profile, run:
# The actual GitLab instance has been redacted.
$ ssh -T git@gitlab.com
If this is the first time connecting to the GitLab instance you will be prompted with a message asking you to continue, answer yes
to add GitLab to the list of trusted hosts. If successful, you should receive a Welcome to GitLab, @username
! message.
With the connection validated, you should be able to add commits to the /partnerhub/web
repo. The last step is to submit a test commit!
Submit test commit
src/content/test
allows you to test your connection to the GitLab instance without impacting QA or Production environments. To test your connection:
- Run:
$ git checkout -b test
- Create a Markdown file with your username as the title
<user@hbo.md>
in thesrc/content/test/
folder. - Commit changes :
$ git add [filename]
$ git commit -m "<commit message>"
$ git push
- Once successful, use the link in the terminal to create a merge request. All merge requests should be assigned to REDACTED.
Congratulations, you just made your first commit, and can now begin contributing to the HBO code base!