Installation and setup

Author

Marie-Hélène Burle

In this section, we will install and configure Git.

Installing Git

MacOS/Linux users

Install Git from the official website.

Windows users

Install Git for Windows. This will also install Git Bash, a Bash emulator.

Git is built for Unix-like systems (Linux and MacOS). In order to use Git from the command line on Windows, you need a Unix shell such as Bash. To make this very easy, Git for Windows comes with its Bash emulator.

Using Git

We will use Git from the command line throughout this workshop.

MacOS users:    open Terminal.
Windows users:   open Git Bash.
Linux users:    open the terminal emulator of your choice.

Configuring Git

Before you can use Git, you need to set some basic configuration. You will do this in the terminal you just opened.

List settings

git config --list

User identity

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

Example:

git config --global user.name "John Doe"
git config --global user.email "john.doe@gmail.com"

It is recommended to use your real name and real email address: when you will collaborate on projects, you will probably want this information to be attached to your commits rather than a weird pseudo.

Text editor

git config --global core.editor "<text-editor>"

Example for nano:

git config --global core.editor "nano"

Line ending

macOS, Linux, or WSL

git config --global core.autocrlf input

Windows

git config --global core.autocrlf true

Project-specific configuration

You can also set project-specific configurations (e.g. maybe you want to use a different email address for a certain project).

In that case, navigate to your project and run the command without the --global flag.

Example:

cd /path/to/project
git config user.email "your_other@email"