Practice Installing Git and creating a GitHub account

Last updated: January 4, 2023

For this course, you need to:

  • Install and configure Git
  • Create a GitHub account (if you don't already have one) and (optionally, but it is really convenient) set up SSH for that account

This lesson will guide you through this.

Install Git

You can download Git from the official Git download page.

If you are on Windows, downloading Git from the Git for Windows project is a better option as this will also provide you with a Bash emulation to run Git in the command line.

How to run Git?

There are many GUIs (Graphical User Interfaces) which allow to run Git, but for this course, we will run Git in the command line (the lesson Tools for a friendlier Git will show you how to use Git in nice visual manners, but still within the command line). The Git GUIs are often buggy, slow, and limiting. So even if you use one, it is important to know how to run Git in the command line.

In this course, to run Git commands, open:

Windows: Git BASH
MacOS: Terminal
Linux: any terminal emulator

Configure Git

Now, you are reading to configure Git.

First, you need to tell Git some information about yourself. This will be used to identify you as the author of commits.

git config --global user.name "Your Name"
git config --global user.email "your@email"

The --global flag tells Git to set those configurations on your entire system rather than for the current repository. That's what we want here since we are setting the basic Git configurations.

Unless you have set a default text editor via a shell environment variable, Git uses the vi editor whenever it prompts you for some text. vi is extremely powerful, but not friendly for those unfamiliar with its modes and keybindings. You might want to use nano (or any editor of your choice) instead:

git config --global core.editor "nano"

To make sure that line endings are properly formatted, you should set:

git config --global core.autocrlf input   # if you are on macOS or Linux
git config --global core.autocrlf true    # if you are on Windows

To see all the configurations you have set, you can run:

git config --list

If one of the values doesn't look right or to change your configuration at any time, just re-run the code with the proper value.

Create a GitHub account

If you don't already have one, create a free GitHub account.

Set up SSH for your GitHub account

Each time you will push or pull to a repo on GitHub, you will be asked to enter your GitHub username and password. This quickly gets tiring.

An easy way to avoid having to do this is to set up SSH for your account.

Note that this is not mandatory and you can enter your password every time if you prefer. But ultimately, you will probably want to set this up.

Important note

If you have issues installing or configuring Git, please sign up for the debug session to make sure that you have a running installation before our next Zoom meeting (we will not have time to debug installation issues during that meeting).

Comments & questions