Setup #
Git Mastery relies on the following tools to be properly setup:
- Git
- Github
- Github CLI
It is very important that these steps are done correctly to ensure that you can follow along.
Git #
Follow the installation steps for your operating system (OS) here.
If you are using Windows, use Git Bash or Windows Subsystem for Linux as Git Mastery only works with Bash.
To ensure that everything is working, run the following commands:
git version
You should see text like this:
git version 2.48.1
To verify that you have access to Bash, try to run the following command:
pwd
If you are using Bash, you should see the current directory displayed.
Once Git is setup on your local machine, do some initial configuration:
git config --global user.email "<your email>"
git config --global user.name "<your name>"
Github #
We strongly encourage the use of SSH for Github as that is the most hassle-free setup.
Create a new Github account if you don’t have an account
The following instructions are taken from the official Github documentation.
Check if you already have an existing SSH key:
ls -al ~/.ssh
# Lists the files in your .ssh directory, if they exist
If you have an existing SSH key, it might have one of the following names:
id_rsa.pub
id_ecdsa.pub
id_ed25519.pub
If you already have an existing SSH key, you can skip the next two steps.
Create a new SSH key:
ssh-keygen -t ed25519 -C "your email"
You can press Enter to accept all of the defaults (including using an empty passphrase).
Add the private SSH key to the ssh-agent
:
ssh-add ~/.ssh/id_ed25519
This step can vary between operating systems. Please refer to this page and select your operating system to ensure that you are using the right steps.
Once done, you can add the SSH key to Github.
Copy the public SSH key (ending with .pub
) to your clipboard:
pbcopy < ~/.ssh/id_ed25519.pub
Then, in Github, go to your settings > “Access” > SSH and GPG keys > New SSH key.
Give it a readable name and paste the contents of your public SSH key.
To verify that Github is working, run the following command:
ssh -T git@github.com
Verify that the fingerprint in the message matches Github’s public key fingerprint and if it does, type yes
.
You should see a message containing your username.
Github CLI #
Git Mastery uses Github CLI to streamline and automate the download and submission processes.
Follow the installation instructions here for your operating system.
After you have installed Github CLI, run the following command to login to your preferred Github account:
gh auth login
You should have setup SSH for Github from the step above. If so, you should select the option for using SSH for Github CLI.
You can verify that it worked by running the following:
gh auth status
Setting up Git Mastery #
Git Mastery provides a script that sets up your local environment for you. Run the following command in a suitable folder and follow the prompts accordingly:
curl -O https://raw.githubusercontent.com/git-mastery/scripts/refs/heads/main/setup.sh \
&& bash setup.sh
Navigate to https://github.com/git-mastery/diagnostic/pulls and find [Your Github username] [diagnostic] Submission.
If you see the following message, you have setup Git Mastery for your local environment successfully!
