Fab Academy 2026: Git & GitLab Reference Guide
Overview
This document summarizes the key concepts from the Fab Academy Recitation 1 on Version Control and GitLab, presented by Julian. Git is fundamental infrastructure that powers version control across many tools and platforms—mastering it is one of the most important skills in Fab Academy.
Fab Academy Platforms
| Platform | Purpose | URL |
|---|---|---|
| Fab Labs IO | Global network platform, single sign-on for all services | fablabs.io |
| GitLab | Open-source Git repository hosting (self-hosted by Fab Academy) | gitlab.fabcloud.org |
| Mattermost | Chat platform for 2026 cohort collaboration | chat.academany.org |
| Nueval | Custom evaluation tool for instructor assessments | (shown later in course) |
GitLab Login
- Go to gitlab.fabcloud.org
- Do NOT use the username/password form
- Click the "Fab Labs.io" button at the bottom
- Log in through Fab Labs IO (single sign-on)
- You'll be redirected back to GitLab, now authenticated
Understanding GitLab Structure
Fab Academy Organization
Fab Academy 2026
└── Labs (group)
└── [Your Lab Name] (e.g., Barcelona, Oulu, Bohol, Zoi)
├── students/
│ └── [your-name]/ ← Your repository
└── site/ (lab's generic website)
Finding Your URL
- All student websites:
fabacademy.org/2026/people - Your URL format:
fabacademy.org/2026/labs/[lab-name]/students/[your-name]
Setup Email
Look for an email with subject containing "Fab Academy" from coordination. This contains your repository setup link.
Git Fundamentals
Key Concepts
| Term | Definition |
|---|---|
| Working Directory | Files you're actively editing on your computer |
| Staging Area | Temporary bucket of files ready to be committed |
| Commit | A saved snapshot of changes with a message |
| Branch | A sequential list of commits (default: main) |
| Repository | All files plus their complete history |
| Local Repository | Git repo on your computer |
| Remote/Origin | Cloud repository (GitLab) |
The Git Workflow
Working Directory → Staging Area → Local Repository → Remote Repository
(edit) (git add) (git commit) (git push)
Working with GitLab Web IDE
Opening the Web Editor
- Navigate to your project in GitLab
- Click the blue "Code" button
- Select "Web IDE" at the bottom
- Editor opens with VS Code-like interface
Making Changes
- Open a file from the left sidebar
- Edit the content
- Click the Source Control tab (shows change count)
- Review changes (before/after comparison)
- Write a commit message
- Click "Commit and push to main"
- First time: Click "Continue" when asked about default branch
Viewing History
- Click the commit hash on your project page to see that commit's changes
- Navigate to Code → Commits to see full history
CI/CD Pipeline (Continuous Integration)
What It Does
Every time you push a commit, GitLab automatically:
1. Reads the .gitlab-ci.yml file
2. Sends instructions to a runner server
3. Builds your website (if using a static site generator)
4. Publishes HTML files to your public URL
The .gitlab-ci.yml File
For plain HTML projects:
image: alpine:latest
pages:
script:
- echo "Nothing to build for HTML"
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
For MkDocs projects:
image: python:latest
pages:
script:
- pip install mkdocs mkdocs-material
- mkdocs build --site-dir public
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
Monitoring Pipelines
- Green checkmark ✓ = Pipeline passed, website deployed
- Blue circle = Running
- Red X = Failed (click to view logs and debug)
Important: Only the most recent successful pipeline matters for your website.
Local Git Setup
Installing Git
- Mac/Linux: Usually pre-installed; verify with
git --version - Windows: Use Windows Subsystem for Linux (WSL) recommended
- Installation guide: git-scm.com/downloads
SSH Key Setup (Recommended Method)
1. Generate a key:
Press Enter for default location, leave passphrase empty for simplicity.2. Copy your public key:
# Mac
cat ~/.ssh/id_ed25519.pub | pbcopy
# Windows (Git Bash)
cat ~/.ssh/id_ed25519.pub | clip
# Linux
cat ~/.ssh/id_ed25519.pub
3. Add to GitLab: - Go to GitLab → Profile → Preferences → SSH Keys - Click "Add new key" - Paste your public key - Save
4. Test connection:
Should return: "Welcome to GitLab, @your-username!"Alternative: Personal Access Token
Used by some editors like VS Code. Create at: GitLab → Profile → Preferences → Access Tokens
Essential Git Commands
Initial Setup (Once)
# Configure your identity
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
Clone Your Repository
# Get the SSH URL from GitLab (Code button → Clone with SSH)
git clone git@gitlab.fabcloud.org:academany/fabacademy/2026/labs/[lab]/students/[name].git
# Move into the project folder
cd [name]
Daily Workflow
# Check status (see what's changed)
git status
# See specific changes
git diff
# Stage specific files
git add filename.html
git add images/photo.jpg
# Stage interactively (review each change)
git add -p
# Commit staged changes
git commit -m "Updated week 2 documentation"
# Push to GitLab
git push
# Pull latest changes (if you edited in Web IDE or another computer)
git pull
Viewing History
Emergency Reset
Nuclear option: If everything is broken, make a backup copy of your folder, delete the repo, clone fresh, and copy your new work back in.
Best Practices
Commit Messages
- ✅ Good: "Updated week 2 with laser cutter documentation"
- ✅ Good: "Added hero image to homepage"
- ✅ Good: "Fixed broken link in navigation"
- ❌ Bad: "update"
- ❌ Bad: "stuff"
- ❌ Bad: "asdfasdf"
Commit Frequency
- Commit often (saves your work incrementally)
- Don't need to push after every commit
- Push at logical breakpoints (end of session, completed section)
File Review Before Committing
Never blindly use git add . — always review what you're adding:
What NOT to Commit
- Large files (>10MB)
- Passwords or API keys
- System files (.DS_Store, Thumbs.db)
- Build outputs (if using static site generators)
File Size Management
Hard Limits
- Single commit: 20MB maximum
- Total repository: 500MB maximum
Image Guidelines
| Guideline | Target |
|---|---|
| File size | Under 100KB per image |
| Dimensions | 800px maximum width |
| Format | JPEG for photos, PNG for graphics |
Optimization Tools
- ImageMagick: Command-line image processing
- Image Optim: Mac app for compression
- TinyPNG: Web service for compression
- Squoosh: Google's web-based optimizer
Video Guidelines
- Compress before uploading
- Target: 1-2MB for short clips
- Consider embedding from YouTube for longer videos (but risks link rot)
HTML Best Practices
Use Relative Links
<!-- ✅ Correct: Relative path -->
<a href="../week02/index.html">Week 2</a>
<img src="images/photo.jpg" alt="My photo">
<!-- ❌ Wrong: Absolute URL -->
<a href="https://fabacademy.org/2026/labs/mylab/students/me/week02/">Week 2</a>
File Naming
- All lowercase
- No spaces (use hyphens:
my-image.jpg) - Simple, descriptive names
External Libraries
Download and include locally rather than linking to CDNs:
<!-- ✅ Local copy (preserved forever) -->
<script src="js/library.js"></script>
<!-- ❌ CDN link (may break in future) -->
<script src="https://cdn.example.com/library.js"></script>
Static Site Generators
MkDocs (Recommended for Markdown)
Advantages: - Write in Markdown (simpler than HTML) - Automatic navigation - Material theme for customization - Easy configuration
Folder Structure:
project/
├── docs/ ← Your Markdown files
│ ├── index.md
│ └── week01/
├── mkdocs.yml ← Configuration
└── .gitlab-ci.yml ← Build instructions
Other Options
- Hugo: Fast, Go-based generator
- Docusaurus: React-based, good for documentation
- Plain HTML: No build step, full control
Templates
Find templates at: gitlab.fabcloud.org/academany/fabacademy/templates/
Troubleshooting
Pipeline Failed
- Click the red X on your commit
- Click the failed job
- Read the log output
- Common issues:
- Missing
.gitlab-ci.ymlfile - Syntax error in YAML
- Missing dependencies
Can't Push
Merge Conflicts
If you edited in both Web IDE and locally:
1. git pull
2. Resolve conflicts in the marked files
3. git add the resolved files
4. git commit
5. git push
SSH Connection Issues
# Test connection
ssh -T git@gitlab.fabcloud.org
# If multiple keys, configure in ~/.ssh/config:
Host gitlab.fabcloud.org
IdentityFile ~/.ssh/id_ed25519
Quick Reference Card
| Action | Command |
|---|---|
| Check status | git status |
| Stage file | git add filename |
| Stage interactively | git add -p |
| Commit | git commit -m "message" |
| Push to remote | git push |
| Pull from remote | git pull |
| View history | git log |
| See changes | git diff |
| Reset to remote | git reset --hard origin/main |
Resources
- GitLab Docs: docs.gitlab.com
- Git Tutorial: git-scm.com/book
- Neil's Notes: academy.cba.mit.edu
- Mattermost: chat.academany.org (ask Julian questions!)
- Templates: gitlab.fabcloud.org/academany/fabacademy/templates
Creating gitlab branch
Initial Machine One-time Setup
- Create a new folder called "Groupwork" (or whatever you want to call it) and change directory into "Groupwork" from within terminal
mkdir Groupwork
cd Groupwork - Run the following to create a new virtual environment to keep your projects organized
python3 -m venv venv - Activate the environment
source venv/bin/activate - Clone the site
git clone git@gitlab.fabcloud.org:academany/fabacademy/2026/labs/charlotte/site.git - Run the command
lsto see the file structure
- Change the directory
cd site - Run the following command to see if the site is ready to edit
mkdocs serve --livereload
Note: On our installation we received the following error: ERROR - Config value 'plugins': The "git-revision-date-localized" plugin is not installed
Resolved:pip install mkdocs-git-revision-date-localized-plugin
Now your environment is ready to create the new branch
To create a new branch:
-
make sure you're starting from main
git checkout main
git pull origin main -
create and switch to your new branch
git checkout -b adults -
push it to GitLab so the remote knows it exists
git push origin adults
Normal workflow:
-
Start on your branch
git checkout adults -
Do your work (edit files, add content, etc.)
-
Stage and commit your changes
git add .
git commit -m "description of what you did" -
Push to GitLab
git push origin adults -
When ready to go live, merge into main
git checkout main
git pull origin main
git merge adults
git push origin main -
Go back to your branch to keep working
git checkout adults
Document created from Fab Academy 2026 Recitation 1: Version Control and GitLab Presenter: Julian (IT Manager)