To get started with using Git and GitHub, you will need to install a few prerequisites on your system as well as create a GitHub account.
-
From the Privileges application, click Request Privileges.
-
Open a Terminal session, and check to see if you have
giton your system:git --versionIf
gitis on your system, you will see a version number in the output, and you do not need to complete the rest of the steps in this section. If you get an error or a message asking whether you would like to installgit, then follow the steps below to install it via Homebrew. -
Install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"The script will walk you step by step through the installation process.
-
Once Homebrew is installed, install
git:brew install git -
Check if
gitwas successfully installed:git --versionThis time, you should see a version number in the output. If for some reason it does not show the version number, close Terminal, restart, and run the command again.
-
Go to https://github.com/ to sign up for an account.
-
Verify your email address. Reference the GitHub documentation if you do not receive a verification email.
-
Go back to Terminal, and configure
gitto use your credentials. ReplaceYour_Namewith your actual name. ReplaceYour_Emailwith the email address you used to create your GitHub account (keep the quotes around these items):git config --global user.name "Your_Name"git config --global user.email "Your_Email"
- From the upper-right corner of your GitHub account, click your user icon and select Settings.
- Scroll down, and on the left, click <> Developer settings.
- From the left menu, select Personal access tokens.
- Click Generate new token.
- For Note, enter any name you want.
- For Expiration, choose whatever date you want. Once this token expires, you will have to create a new one.
- For Select scopes, check the box next to repo.
- Click Generate token.
- On the next page, you will see your new Personal Access Token. Copy that token to a text file — you will be unable to retrieve the token again after this screen. When you push files to GitHub from your machine, you will need to use this token when prompted for a password. Have the token handy at that time.