What operating system is your computer running?
Open your Terminal. You can do this with command + spacebar, then start typing "terminal" and hit enter when it has auto-completed.
If you do not have Homebrew installed (or don't know what Homebrew is), run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
This will prompt you for the password you use to log in to your computer. Enter your password and press enter on your keyboard to begin the installation.
Once Homebrew has finished installing, there will be two commands under "Next steps" in the output, they will look something like:
(echo; echo ‘eval “$(/opt/homebrew/bin/brew shellenv)”’) >> /Users/your-user-name/.zprofile
eval “$(/opt/homebrew/bin/brew shellenv)”
Copy and paste the lines from the output into your terminal and press enter.
Now quit your terminal and re-open it for changes to take effect.
Once you have re-opened your terminal with Homebrew installed, run: brew install git
This should install git. Once the process is completed, try typing git in the terminal and pressing enter.
If git has been installed correctly, you should see output with usage and other tips about using git.
Install Git for Windows.
Once installation has completed, open the program.
Type git and push enter - you should see output with usage and other tips about using git.
Open your terminal. You can use Ctrl + Alt + T, or find it in your applications menu.
On a Debian-based distribution (such as Ubuntu), try apt. Enter the following into your terminal: sudo apt install git-all
On a different distribution (such as Fedora or Arch) that does not use apt, you can find similar commands in the Git documentation.
Run these lines one at a time, substituting your name in the first line and your email (the email you registered for GitHub with) in the second line:
git config --global user.name "George Washington"
git config --global user.email george.squashington@email.gwu.edu
git config --global init.defaultBranch main
git config --global core.editor "code --wait"
git config --global pull.rebase false
In your terminal or git-bash, run this command with the email associated with your GitHub account:
ssh-keygen -t rsa -C “george.squashington@email.gwu.edu”
When it asks you to “Enter a file in which to save the key”, press enter to save it to the default location.
When it asks you to enter a password, press enter to skip using a password.
In your terminal, run: ssh-add ~/.ssh/id_rsa
(note: if that doesn't work and you get an error message, run: eval $(ssh-agent) and then try again)
In your terminal, run the following command to add your key to the clipboard: pbcopy < ~/.ssh/id_rsa.pub
While logged into your GitHub account, go to:
https://github.com/settings/keys
Click on the green “New SSH key” button.
Leave the title blank, and then paste your key into the “key” section.
Click the green “Add SSH key” button.
In your terminal, run: ssh -T git@github.com
If the output says “The authenticity of host 'github.com' .... can't be established ... Are you sure you want to continue connecting (yes/no)?” Type yes and hit enter.
You should see Hi