Chapter 4 — Initial Setup
Overview: Getting Your Machine Ready
This chapter covers everything you need to do once on each machine you use. After completing this setup, your machine will be ready to work with the group's repositories.
Estimated time: 20–30 minutes.
Step 1: Install Git
Git is pre-installed on macOS via Xcode Command Line Tools. To verify:
If Git is not installed (or the version is old), install via Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install git
Recommended minimum version: 2.30 or later.
Download and install Git for Windows.
During installation: - Select "Use Git from the Windows Command Prompt" - Select "Checkout Windows-style, commit Unix-style line endings" - Select "Use MinTTY" as the terminal emulator
After installation, use Git Bash for all commands in this handbook.
Step 2: Configure Your Identity
Git records your name and email with every commit. This must match your GitHub account.
git config --global user.name "Your Full Name"
git config --global user.email "your.email@example.com"
Use your institute email
Use your university or institute email — the same email registered on GitHub. Do not use a personal email. This ensures commits are attributed correctly on GitHub and in the audit log.
Verify:
Step 3: Configure Your Default Editor
Git opens a text editor when you need to write a commit message (if you omit -m)
or resolve a rebase. Set this to your preferred editor.
Step 4: Set the Default Branch Name
Git historically used master as the default branch name.
This group uses main. Configure your Git to match:
Step 5: Configure Line Endings
Line ending mismatches between macOS/Linux and Windows cause noise in diffs.
Step 6: Verify Your Configuration
Review all your global settings:
You should see at minimum:
user.name=Your Full Name
user.email=your.email@example.com
core.editor=code --wait
init.defaultbranch=main
core.autocrlf=input
Step 7: Create a GitHub Account
If you do not already have a GitHub account:
- Go to https://github.com
- Click Sign up
- Use your institute email
- Choose a professional username (e.g.,
firstname-lastnameorflastname) - Complete email verification
Profile settings (recommended):
- Add your full name under Settings → Profile
- Add a photo (helps reviewers identify who they are working with)
- Set your organisation affiliation
After creating your account, give your GitHub username to the group maintainer so they can add you as a collaborator on the group repositories.
Step 8: Verify Git Installation
SSH setup is covered in the next chapter. You are not yet ready to push or pull.
Common Mistakes
-
Using a personal email instead of the institute email. Commits will not be linked to your GitHub profile correctly, and the group's audit records will be incomplete.
-
Skipping
user.email. Git will warn you on every commit. -
Not setting
init.defaultBranch main. New repositories will start onmasterinstead ofmain, causing confusion. -
Configuring at repository level instead of global. Without
--global, settings only apply to the current repository. Use--globalfor all identity settings.
Best Practice Summary
- Run these setup steps on every new machine you use.
- Use your institute email in all Git and GitHub configurations.
- Use VS Code as your Git editor if you already use VS Code for development.
- Verify your setup with
git config --global --listbefore proceeding.
Checklist
- Git is installed (version 2.30+).
-
user.nameis configured with my full name. -
user.emailis configured with my institute email. - Default editor is configured.
-
init.defaultBranchis set tomain. - Line endings are configured for my OS.
- GitHub account exists and uses my institute email.
- I have given my GitHub username to the group maintainer.
Exercises
-
Verify identity. Run
git config --global --listand confirm your name and email are set correctly. -
Test the editor. Run
git config --global core.editorand confirm the output is what you set. -
GitHub profile. Log into GitHub, go to Settings → Profile, and add your full name and institute affiliation if not already present.