Create a GitHub account here
If a Mac user then you need to open your terminal. After that you should install HomeBrew which you can do with the following command. HomeBrew is going to allow us to install additional things that are not included with the Mac OS. It will be our way to install Git.
(The $
represents the prompt. This is not something you type and yours could look different)
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
You may get a few prompts and be asked for your password. This is the password you use to log in to your computer. After it is installed you will need to run the command brew doctor
.
$ brew doctor
Next perform an update to make sure that you have everything you need.
$ brew update
Now we can install Git with the following command.
$ brew install git
This will install Git on your computer globally so that you are now able to use it as a version control. However, this does not do anything with GitHub. At this point we are simply setting up our personal computer to use Git.
At this point you should be able to type git --version
in your terminal and get a version number back. If not, then the install was not successful.
If you are on a Windows machine then I suggest using GitBash as your command prompt/terminal instead of powershell. It will allow you to use common bash commands (although some do not work) and use Git commands.
We now have Git installed and a GitHub account, but we do not have a bridge connecting the two. That is what we are going to do next through an SSH key
.
Your first step is to generate a new SSH key. If you follow the steps in this link then you should get everything created locally.
Your next step is to add the key to your GitHub account. This link should help with the second step of this process.
(This process can be intimidating at first but just be sure to read over the directions and follow each step. Ask for help if you need it!)
Next we can do a quick test in the terminal to see if we can connect to GitHub by typing the following command.
$ ssh -T [email protected]
The first time you may get the message:
The authenticity of host 'github.com (192.30.252.1)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)?
or possibly:
The authenticity of host 'github.com (192.30.252.1)' can't be established.
RSA key fingerprint is nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?
You need to simply type yes
in the prompt, press RETURN
and you should receive this response:
Hi {USER_NAME}! You've successfully authenticated, but GitHub does not provide shell access.
You are now ready to start using Git AND GitHub! 👍