A visual, step-by-step tutorial for teams collaborating on training content. Covers repositories, branching, pull requests, and the full Git workflow — no prior experience needed.
Please complete the following steps before the session. Each one should take no more than 10 minutes.
Working on an institutional or work-managed computer? Some organisations restrict software installation on their machines. If you are unable to install Git or VS Code, please contact your IT department in advance and let them know you need these tools for a training session. Allow a few extra days in case approval is required. If installation is not possible before the session, please let the facilitator know so alternative arrangements can be made.
Git is the version control tool that runs on your computer.
Mac
- Open the Terminal app (search for it in Spotlight with
Cmd + Space) - Type
git --versionand press Enter - If Git is not installed, macOS will prompt you to install the Xcode Command Line Tools — click Install and follow the prompts
- Once complete, run
git --versionagain to confirm it worked — you should see something likegit version 2.x.x
Windows
- Go to https://git-scm.com/download/win
- Download the installer and run it
- Accept the default options throughout the installation wizard
- Once installed, open Git Bash (search for it in the Start menu) and run
git --versionto confirm
Linux (Ubuntu/Debian)
- Open the Terminal
- Run
sudo apt update && sudo apt install git - Confirm with
git --version
GitHub is where you will store and share your Git repositories online.
- Go to https://github.com
- Click Sign up and follow the steps to create a free account
- Verify your email address when prompted
- You do not need to pay for any plan — the free tier is sufficient for this tutorial
Already have a GitHub account? You're all set.
A text editor is where you will edit files during the demo. Your computer already has a basic one built in — Notepad on Windows and TextEdit on Mac — and either is perfectly fine for this session.
If you would like a more feature-rich editor with built-in Git support, we recommend Visual Studio Code (VS Code), which is free and works on all platforms.
- Go to https://code.visualstudio.com
- Click Download — the site will detect your operating system automatically
- Run the installer and follow the prompts
- Open VS Code and confirm it launches correctly
VS Code is optional. If you are on an institutional machine and cannot install software, your built-in editor is sufficient for this tutorial.
During the demo you will be creating and editing files from the terminal. To avoid confusion about where your files are, please create a dedicated practice folder on your Desktop before the session.
Mac and Linux
- Open the Terminal
- Run the following commands one at a time, pressing Enter after each:
cd ~/Desktop mkdir git-practice - You should now see a folder called
git-practiceon your Desktop
Windows
- Open Git Bash (installed with Git in step 1)
- Run the following commands one at a time, pressing Enter after each:
cd ~/Desktop mkdir git-practice - You should now see a folder called
git-practiceon your Desktop
For the rest of the session, this is your working directory — the folder where all your files will live. When the tutorial asks you to run a command, make sure you are inside this folder by running
cd ~/Desktop/git-practicefirst.
A repository is the folder where GitHub stores and tracks your project. You will need one set up before the session.
- Log in to https://github.com
- Click the + icon in the top-right corner and select New repository
- Fill in the details as follows:
- Repository name:
git-practice - Description: leave blank for now
- Visibility: select Public
- Initialise this repository with: tick Add a README file
- Leave all other options as their defaults
- Repository name:
- Click Create repository
- You should now see your new repository page at
https://github.com/yourusername/git-practice
Why Public? A public repository is visible to anyone on the internet, but only you can make changes to it. For this tutorial, Public is required if you plan to use GitHub Pages to view the tutorial in a browser. You can always change the visibility to Private afterwards.
Why initialise with a README? This ensures the repository is not empty, which makes it easier to clone to your local machine in the next steps.
GitHub requires a Personal Access Token (PAT) to authenticate Git operations from the command line. Think of it as a password specifically for Git — you will need it when pushing and pulling during the session.
- Log in to https://github.com
- Click your profile picture in the top-right corner and select Settings
- Scroll to the bottom of the left sidebar and click Developer settings
- Click Personal access tokens → Tokens (classic)
- Click Generate new token (classic)
- Fill in the details as follows:
- Note:
git-practice - Expiration: 30 days
- Scopes: tick repo (this automatically ticks all the sub-items below it)
- Note:
- Click Generate token
- Copy the token immediately — GitHub will only show it once. Paste it somewhere safe such as a notes app or password manager before closing the page.
When Git asks for your password during the session, paste this token instead of your GitHub account password.
On a Mac? macOS may store your credentials in the keychain automatically. If Git does not prompt you for a password at all, or if you see an authentication error, run the following in your terminal to clear cached credentials and try again:
git credential-osxkeychain erase host=github.com protocol=httpsThen press Enter twice, and retry your Git command.
Before the session, make sure you can tick all six:
- Running
git --versionin your terminal returns a version number - You can log in to github.com
- You have a text editor available (built-in Notepad/TextEdit is fine)
- A
git-practicefolder exists on your Desktop - A
git-practicerepository exists on your GitHub account - You have a Personal Access Token copied and saved somewhere safe
This tutorial is built as a single self-contained HTML file and hosted via GitHub Pages. Open it in any modern browser — no installation required.
Live tutorial: https://msuicaut.github.io/git-github-tutorial
This tutorial covers the core Git and GitHub workflow. For deeper learning, including topics such as ignoring files with .gitignore and resolving merge conflicts, we recommend:
Software Carpentry — Version Control with Git https://swcarpentry.github.io/git-novice/
Software Carpentry offers free, peer-reviewed lessons designed for researchers and practitioners with little to no prior programming experience.
This tutorial was created by May Chan with the assistance of Claude (Anthropic), an AI assistant. Claude supported the instructional design, visual layout, HTML and SVG coding, and iterative refinement of diagrams and explanatory text across multiple working sessions.
The pedagogical approach — including the choice of analogies, colour logic, diagram directionality, and novice-friendly language — reflects a collaborative process between the author and the AI.
If you run into any issues setting up before the session, please reach out so we can help you get sorted ahead of time.
If you run into any issues setting up before the session, please reach out so we can help you get sorted ahead of time.