Setting up Git and GitHub

Follow along this guide to install and configure Git, create a GitHub account, and link Git to GitHub

Installing Git

You will need to install Git on your local machine.

Configuring Git

This guide assumes that you are using Git Bash (for Windows) or the terminal (for macOS and Linux), as we will be using Bash commands. If you are facing issues running certain commands (especially on Windows), please consider using Git Bash instead.

To ensure that Git installed correctly, run the following command:

git version

You should see a line of output like this:

git version 2.54.0

Once Git is installed on your local machine, tell Git who you are:

git config --global user.name '<your full name>'
git config --global user.email '<your email address>'

Then, tell Git about your preferred default code editor:

git config --global core.editor '<editor executable>'

For example, to use Visual Studio Code as your default editor for Git, replace <editor executable> from above with code --wait :

git config --global core.editor 'code --wait'

Setting up GitHub

Create a new GitHub account if you don't have one.

Then, connect Git to GitHub with SSH:

To verify that your SSH connection to GitHub is working correctly, refer to this GitHub documentation, or run the following command:

You should see output like this:

Congrats! You have successfully installed Git, and configured it to connect to GitHub on your local machine! 🥳

Last updated