Installation and setup
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.
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"
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"