|
| 1 | +# Git & GitHub — A Beginner's Guide |
| 2 | + |
| 3 | +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. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +Please complete the following steps **before the session**. Each one should take no more than 10 minutes. |
| 10 | + |
| 11 | +> **Working on an institutional or work-managed computer?** |
| 12 | +> 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. |
| 13 | +
|
| 14 | +--- |
| 15 | + |
| 16 | +### 1. Install Git |
| 17 | + |
| 18 | +Git is the version control tool that runs on your computer. |
| 19 | + |
| 20 | +**Mac** |
| 21 | + |
| 22 | +1. Open the **Terminal** app (search for it in Spotlight with `Cmd + Space`) |
| 23 | +2. Type `git --version` and press Enter |
| 24 | +3. If Git is not installed, macOS will prompt you to install the **Xcode Command Line Tools** — click Install and follow the prompts |
| 25 | +4. Once complete, run `git --version` again to confirm it worked — you should see something like `git version 2.x.x` |
| 26 | + |
| 27 | +**Windows** |
| 28 | + |
| 29 | +1. Go to [https://git-scm.com/download/win](https://git-scm.com/download/win) |
| 30 | +2. Download the installer and run it |
| 31 | +3. Accept the default options throughout the installation wizard |
| 32 | +4. Once installed, open **Git Bash** (search for it in the Start menu) and run `git --version` to confirm |
| 33 | + |
| 34 | +**Linux (Ubuntu/Debian)** |
| 35 | + |
| 36 | +1. Open the Terminal |
| 37 | +2. Run `sudo apt update && sudo apt install git` |
| 38 | +3. Confirm with `git --version` |
| 39 | + |
| 40 | +--- |
| 41 | + |
| 42 | +### 2. Create a GitHub Account |
| 43 | + |
| 44 | +GitHub is where you will store and share your Git repositories online. |
| 45 | + |
| 46 | +1. Go to [https://github.com](https://github.com) |
| 47 | +2. Click **Sign up** and follow the steps to create a free account |
| 48 | +3. Verify your email address when prompted |
| 49 | +4. You do not need to pay for any plan — the free tier is sufficient for this tutorial |
| 50 | + |
| 51 | +> Already have a GitHub account? You're all set. |
| 52 | +
|
| 53 | +--- |
| 54 | + |
| 55 | +### 3. Ensure Access to a Text Editor |
| 56 | + |
| 57 | +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. |
| 58 | + |
| 59 | +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. |
| 60 | + |
| 61 | +1. Go to [https://code.visualstudio.com](https://code.visualstudio.com) |
| 62 | +2. Click **Download** — the site will detect your operating system automatically |
| 63 | +3. Run the installer and follow the prompts |
| 64 | +4. Open VS Code and confirm it launches correctly |
| 65 | + |
| 66 | +> VS Code is optional. If you are on an institutional machine and cannot install software, your built-in editor is sufficient for this tutorial. |
| 67 | +
|
| 68 | +--- |
| 69 | + |
| 70 | +### 4. Set Up a Working Directory |
| 71 | + |
| 72 | +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. |
| 73 | + |
| 74 | +**Mac and Linux** |
| 75 | + |
| 76 | +1. Open the **Terminal** |
| 77 | +2. Run the following commands one at a time, pressing Enter after each: |
| 78 | + ``` |
| 79 | + cd ~/Desktop |
| 80 | + mkdir git-practice |
| 81 | + ``` |
| 82 | +3. You should now see a folder called `git-practice` on your Desktop |
| 83 | + |
| 84 | +**Windows** |
| 85 | + |
| 86 | +1. Open **Git Bash** (installed with Git in step 1) |
| 87 | +2. Run the following commands one at a time, pressing Enter after each: |
| 88 | + ``` |
| 89 | + cd ~/Desktop |
| 90 | + mkdir git-practice |
| 91 | + ``` |
| 92 | +3. You should now see a folder called `git-practice` on your Desktop |
| 93 | + |
| 94 | +> 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-practice` first. |
| 95 | +
|
| 96 | +--- |
| 97 | + |
| 98 | +### 5. Create a Repository on GitHub |
| 99 | + |
| 100 | +A repository is the folder where GitHub stores and tracks your project. You will need one set up before the session. |
| 101 | + |
| 102 | +1. Log in to [https://github.com](https://github.com) |
| 103 | +2. Click the **+** icon in the top-right corner and select **New repository** |
| 104 | +3. Fill in the details as follows: |
| 105 | + - **Repository name:** `git-practice` |
| 106 | + - **Description:** leave blank for now |
| 107 | + - **Visibility:** select **Public** |
| 108 | + - **Initialise this repository with:** tick **Add a README file** |
| 109 | + - Leave all other options as their defaults |
| 110 | +4. Click **Create repository** |
| 111 | +5. You should now see your new repository page at `https://github.com/yourusername/git-practice` |
| 112 | + |
| 113 | +> **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. |
| 114 | +
|
| 115 | +> **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. |
| 116 | +
|
| 117 | +--- |
| 118 | + |
| 119 | +### Quick checklist |
| 120 | + |
| 121 | +Before the session, make sure you can tick all five: |
| 122 | + |
| 123 | +- [ ] Running `git --version` in your terminal returns a version number |
| 124 | +- [ ] You can log in to [github.com](https://github.com) |
| 125 | +- [ ] You have a text editor available (built-in Notepad/TextEdit is fine) |
| 126 | +- [ ] A `git-practice` folder exists on your Desktop |
| 127 | +- [ ] A `git-practice` repository exists on your GitHub account |
| 128 | + |
| 129 | +--- |
| 130 | + |
| 131 | +## About this tutorial |
| 132 | + |
| 133 | +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. |
| 134 | + |
| 135 | +**Live tutorial:** [https://yourusername.github.io/your-repo-name](https://yourusername.github.io/your-repo-name) |
| 136 | + |
| 137 | +--- |
| 138 | + |
| 139 | +## Additional Resources |
| 140 | + |
| 141 | +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: |
| 142 | + |
| 143 | +**Software Carpentry — Version Control with Git** |
| 144 | +[https://swcarpentry.github.io/git-novice/](https://swcarpentry.github.io/git-novice/) |
| 145 | + |
| 146 | +Software Carpentry offers free, peer-reviewed lessons designed for researchers and practitioners with little to no prior programming experience. |
| 147 | + |
| 148 | +--- |
| 149 | + |
| 150 | +## Development Notes |
| 151 | + |
| 152 | +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. |
| 153 | + |
| 154 | +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. |
| 155 | + |
| 156 | +--- |
| 157 | + |
| 158 | +## Questions? |
| 159 | + |
| 160 | +If you run into any issues setting up before the session, please reach out so we can help you get sorted ahead of time. |
| 161 | + |
| 162 | +If you run into any issues setting up before the session, please reach out so we can help you get sorted ahead of time. |
0 commit comments