Week 1: Git & GitHub Fundamentals
For Diploma Computer Science Students
Week Overview
This week, you'll learn version control - one of the most important skills in software development. Version control is like a detailed diary for your code: it records every change you make, who made it, when, and why.
What You'll Learn:
- ✅ What Git is and why developers use it
- ✅ How to set up Git on your computer
- ✅ Creating your first Git repository
- ✅ Making commits (saving changes with descriptions)
- ✅ Using GitHub to share your code
- ✅ Understanding branches and merging
- ✅ Collaborative development basics
Learning Time: 5 days (Monday-Friday)
Practicum: 2-3 hours per day
Daily Schedule
| Day |
Topic |
Time |
Output |
| Monday |
What is Git? Installation & Setup |
2 hours |
Git installed, first config |
| Tuesday |
Your First Repository |
2 hours |
First repo created locally |
| Wednesday |
Git Commits & History |
2.5 hours |
5+ commits in your repo |
| Thursday |
GitHub & Remote Repositories |
2.5 hours |
Repository pushed to GitHub |
| Friday |
Branches & Collaboration |
2 hours |
Branch created, merge practiced |
Why You Need This (Uganda Context)
Imagine you're building a payment app for Uganda like Pesalink or MTN Mobile Money:
- Your boss asks: "Can you show me what changed between yesterday and today?"
- Your team member breaks something: How do you go back to the version that worked?
- Two developers work on the same project: How do you combine their work without losing anything?
- You need to test a new feature: You don't want to break the working version.
That's what Git solves.
Real Uganda example: When MTN Uganda updates their mobile app, hundreds of developers work on it. Git ensures:
- Each developer works on their own feature without breaking others' work
- Changes are tracked (who did what, when, and why)
- It's easy to fix bugs by going back to previous versions
- Teams can collaborate efficiently across Kampala and beyond
MONDAY: What is Git? Installation & Setup
1. Understanding Git (30 minutes)
What is Git?
Git is a version control system - software that tracks changes to your code over time.
Think of it like this:
Without Git: You have files on your computer. You make changes. If you mess up, you're stuck. Maybe you've done this:
project.py
project_v2.py
project_final.py
project_ACTUAL_FINAL.py
project_REALLY_FINAL.py
This is chaotic and unprofessional.
With Git: You have ONE file. Git records every change. You can see exactly what changed, go back to any previous version, and understand why each change was made.
Why Git Matters
- History: Every change is recorded with a message
- Teamwork: Multiple people can work on the same project
- Safety: Broken code? Roll back to a working version in seconds
- Backup: Your code exists in multiple places (your computer + GitHub)
- Professionalism: Every job in tech uses Git
Git vs GitHub (Important Distinction!)
- Git = The software that tracks changes (runs on your computer)
- GitHub = A website where you upload your Git repositories (cloud storage for code)
Analogy: Git is like your personal notebook. GitHub is like posting your notebook online for others to see and collaborate.
2. Installing Git (30 minutes)
Windows Installation
Step 1: Go to false
Step 2: The download should start automatically. If not, click the link for your Windows version (64-bit is standard).
Step 3: Run the installer. Accept the default options except:
- When asked about "Adjusting PATH environment," select "Git from the command line and also from 3rd-party software"
- Keep other defaults
Step 4: Complete the installation
Verify Installation
Open Command Prompt or PowerShell on Windows and type:
git --version
You should see something like:
git version 2.40.0
If you see this, Git is installed successfully! ✅
3. Configuring Git (30 minutes)
Now that Git is installed, you need to tell it who you are. This is important because Git will record your name with every change you make.
Set Your Name and Email
Open Terminal/Command Prompt and run these commands:
git config --global user.name "Your Full Name"
git config --global user.email "your.email@example.com"
Example for Joannah Kuteesa:
git config --global user.name "Joannah Kuteesa"
git config --global user.email "joannah.kuteesa@gmail.com"
Example for Jordan Mulungi Kaweesi:
git config --global user.name "Jordan Mulungi Kaweesi"
git config --global user.email "jordan.kaweesi@gmail.com"
Verify Configuration
Check that it worked:
git config --global --list
You should see:
user.name=Joannah Kuteesa
user.email=joannah.kuteesa@gmail.com
4. Creating Your First Folder (15 minutes)
You need a place on your computer where you'll practice Git.
Windows Users
- Open File Explorer
- Create a new folder. Name it:
MyFirstRepo
- Right-click inside the folder
- Select "Open in Terminal" (or "Git Bash Here" if you have it)
5. Initializing Your First Repository (15 minutes)
Now you're in the folder. Initialize Git:
git init
You should see:
Initialized empty Git repository in /path/to/MyFirstRepo/.git
Congratulations! 🎉 You've created your first Git repository!
What happened? Git created a hidden folder called .git that will track all your changes from now on.
To see it:
Windows (Command Prompt):
dir /a
You should see a .git folder listed.
End of Day 1 Checklist
Reflection Question:
Write down in one sentence: What problem does Git solve?
TUESDAY: Your First Repository
1. Understanding Repositories (15 minutes)
A repository (or "repo") is just a folder with Git tracking it. It contains:
- Your project files (code, images, documents)
- The
.git folder (where Git stores the history)
Think of it like a project folder at work that has:
- Your code files
- A filing cabinet (
.git) with complete records of every change
2. Creating Real Project Files (30 minutes)
Now let's create some actual code to version control. You'll create a simple HTML file about Uganda.
Step 1: Create an HTML File
In your MyFirstRepo folder, create a file called index.html
Windows: Right-click > New > Text Document > Rename to index.html, or run New-Item index.html -ItemType File in PowerShell.
Step 2: Add Content
Open index.html in a text editor (Notepad, VS Code, etc.) and add:
<!DOCTYPE html>
<html>
<head>
<title>Welcome to Uganda Tech</title>
</head>
<body>
<h1>Uganda's Growing Tech Industry</h1>
<p>Welcome! This page celebrates Uganda's amazing tech innovation.</p>
<h2>Key Companies</h2>
<ul>
<li>Jumia Uganda - E-commerce platform</li>
<li>MTN Uganda - Telecommunications & Mobile Money</li>
<li>Pesalink - Fast mobile money transfer</li>
</ul>
<p>Created by: [Your Name]</p>
</body>
</html>
Replace [Your Name] with your actual name.
Step 3: Add Another File
Create a file called about.txt with:
About This Project
==================
This is my first Git repository.
I'm learning version control in Week 1 of my diploma.
It's exciting to finally understand how professionals manage code!
Step 4: Save Both Files
Make sure both files are saved in your MyFirstRepo folder.
3. Checking Repository Status (20 minutes)
Now let's ask Git: "What files do you see?"
In Terminal/Command Prompt (in your MyFirstRepo folder), run:
git status
You should see something like:
On branch master
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
about.txt
index.html
nothing added to commit but untracked files present (tracking files)
What this means:
- Git sees your files (
about.txt and index.html)
- They're "untracked" - Git is not yet recording their history
- We need to tell Git to start tracking them
4. Staging Files (30 minutes)
Staging is the step where you tell Git: "Here are the changes I want to record."
It's like preparing items to be mailed:
- You gather items (staging)
- You put them in a box and seal it (committing)
- You send the box (pushing to GitHub)
Stage All Files
git add .
The . means "add everything in this folder."
You can also add individual files:
git add index.html
git add about.txt
Check Status Again
git status
Now you should see:
On branch master
No commits yet
Changes to be committed:
(use "rm --cached <file>..." to unstage)
new file: about.txt
new file: index.html
What changed? The files are now "staged" - they're ready to be recorded.
5. Making Your First Commit (20 minutes)
A commit is when you officially record changes with a message explaining what you did.
Create Your First Commit
git commit -m "Initial commit: Add Uganda tech project"
Breaking this down:
git commit = Record the staged changes
-m = The next thing is a message
"Initial commit: Add Uganda tech project" = Your message describing the change
You should see:
[master (root-commit) a1b2c3d] Initial commit: Add Uganda tech project
2 files changed, 15 insertions(+)
create mode 100644 about.txt
create mode 100644 index.html
Congratulations! 🎉 Your first commit is recorded!
6. Viewing Your History (20 minutes)
Git keeps a complete history. Let's see it:
git log
You should see:
commit a1b2c3d4e5f6g7h8i9j0 (HEAD -> master)
Author: Joannah Kuteesa <joannah.kuteesa@gmail.com>
Date: Mon Sep 1 10:30:00 2026 +0000
Initial commit: Add Uganda tech project
This shows:
- commit ID: A unique code for this change
- Author: Who made the change (you!)
- Date: When it was made
- Message: What was changed
Practical Exercise: Make a Second Commit
Step 1: Modify index.html
Add more content to index.html. Change the line:
<p>Created by: [Your Name]</p>
To something like:
<p>Created by: Joannah Kuteesa</p>
<p>This page was created on September 1, 2026</p>
Step 2: Stage the Changes
git add index.html
Step 3: Commit with a Meaningful Message
git commit -m "Add creation date and author name to index.html"
Step 4: View Your History
git log
You should now see TWO commits!
Understanding Commit Messages
Good commit messages are:
- Short and specific: "Add navigation menu" (not "Update website")
- Written in present tense: "Add feature" (not "Added feature")
- Descriptive: Someone should understand what changed without seeing the code
Good Examples:
- ✅ "Add user authentication"
- ✅ "Fix bug in login form validation"
- ✅ "Update README with installation instructions"
- ✅ "Refactor database queries for performance"
Bad Examples:
- ❌ "Update stuff"
- ❌ "asdfgh"
- ❌ "Fix things"
- ❌ "Final version"
Uganda Context: Real Commit Examples
When developers at Jumia Uganda work on features, they write messages like:
- "Add Pesalink payment option"
- "Fix mobile money verification for MTN"
- "Update product filtering for Ugandan categories"
- "Optimize search for slow internet connections"
Each message tells the story of how the app evolved.
End of Day 2 Checklist
Reflection Question:
Why is a good commit message important? Think about working in a team - what would you want to know when reviewing someone else's changes?
WEDNESDAY: Git Commits & History
1. Understanding the Commit Workflow (30 minutes)
Every time you make changes in Git, you follow this cycle:
EDIT FILES → STAGE FILES → COMMIT → HISTORY RECORDED
(Write) (Prepare) (Save) (Permanent)
Today, you'll practice this cycle multiple times and become comfortable with it.
The Three States
1. Working Directory - Your actual files that you're editing
2. Staging Area - Files you've selected to commit (ready to save)
3. Git Repository - The permanent history stored in .git
Think of it like this:
- Working Directory = Your desk with papers
- Staging Area = The papers you put in a pile to mail
- Git Repository = The mailbox (everything is officially recorded)
2. Practice Cycle 1: Updating Your Content (1 hour)
Step 1: Add More Content
Edit your index.html file. Add this section about Uganda's tech hub:
<h2>Uganda's Tech Hub - Kampala</h2>
<p>Kampala is emerging as East Africa's leading tech hub with:</p>
<ul>
<li>Over 200+ active startups</li>
<li>Co-working spaces across the city</li>
<li>Universities producing tech talent</li>
<li>Growing investor interest</li>
</ul>
<h2>Future Opportunities</h2>
<p>Uganda's tech sector is growing at 30% annually, creating opportunities in:</p>
<ul>
<li>E-commerce</li>
<li>Financial Technology (FinTech)</li>
<li>Mobile Applications</li>
<li>Data Analytics</li>
</ul>
Step 2: Check Status
git status
You should see:
On branch master
Changes not staged for commit:
(use "git add <file>..." to include in what will be committed)
modified: index.html
no changes added to commit but untracked files present (tracking files)
This means Git detected changes but they're not staged yet.
Step 3: View the Differences
Before committing, let's see exactly what changed:
git diff index.html
This shows:
- Lines with
- = removed
- Lines with
+ = added
This is powerful - you can review changes before committing.
Step 4: Stage and Commit
git add index.html
git commit -m "Add Kampala tech hub information and future opportunities"
Step 5: View Your Growing History
git log --oneline
The --oneline flag shows a shorter version. You should see:
3a4b5c6 Add Kampala tech hub information and future opportunities
d7e8f9g Add creation date and author name to index.html
a1b2c3d Initial commit: Add Uganda tech project
Notice: Your commits are listed with the newest first (at the top).
3. Practice Cycle 2: Create a New File (45 minutes)
Now create a new file with information about Uganda's developers.
Step 1: Create developers.md
Create a new file called developers.md and add:
# Uganda's Developer Community
## Who Are They?
Uganda has a vibrant developer community consisting of:
- Young graduates from Makerere University
- Self-taught developers using online resources
- Professionals transitioning from other fields
- Tech professionals from companies like Jumia and MTN
## Popular Programming Languages in Uganda
1. **Python** - Data science and automation
2. **JavaScript** - Web and mobile app development
3. **Java** - Enterprise applications
4. **PHP** - Web server development
5. **React Native** - Mobile app development (cross-platform)
## Learning Resources in Uganda
- Online: Coursera, Udemy, freeCodeCamp
- In-person: Coding bootcamps in Kampala
- Communities: Tech meetups and hackathons
- Universities: Makerere, Kyambogo, KCCA
## Salary Ranges (Approximate)
| Level | Annual Salary (UGX) |
|-------|---------------------|
| Junior Developer (0-2 years) | 20M - 40M |
| Mid-level Developer (2-5 years) | 40M - 80M |
| Senior Developer (5+ years) | 80M - 150M+ |
| Tech Lead | 120M - 200M+ |
**Note:** These are approximate ranges and vary by company and specialization.
## Job Market Growth
Uganda's tech sector is growing rapidly:
- 2023: ~4,000 developer jobs
- 2024: ~5,200 developer jobs
- 2025: ~6,500 developer jobs (projected)
This is YOUR market! Get good at Git and you'll be competitive.
Step 2: Check Status
git status
Step 3: Stage Both the New File and Any Changes
git add .
Step 4: Commit
git commit -m "Add developer community and market information"
Step 5: View Log
git log --oneline
4. Undoing Changes (Advanced - 30 minutes)
Sometimes you make a mistake. Git makes it easy to undo things.
Scenario 1: You Modified a File But Haven't Staged It Yet
Create a test file called test.txt with any content:
echo "This is a test file" > test.txt
Now make a change:
echo "This is a mistake" >> test.txt
You realize: "Oh no! I made a mistake!"
Solution: Discard the changes:
git checkout test.txt
The file is restored to its previous state.
Scenario 2: You Staged a File But Haven't Committed Yet
Create a new file:
echo "Another test" > test2.txt
Stage it:
git add test2.txt
Oh no! You didn't mean to add that file yet.
Solution: Unstage it:
git reset test2.txt
The file still exists, but Git is no longer tracking it.
Scenario 3: You Made a Commit with a Typo in the Message
You committed something but the message had a typo.
Solution: Amend the last commit:
git commit --amend -m "New message without typos"
This changes the message of your most recent commit.
5. Detailed Log Viewing (20 minutes)
Git offers many ways to view history. Here are some useful ones:
Show Full Commits
git log
Show One-Line Summary
git log --oneline
Show Last N Commits
git log -5
Shows the last 5 commits.
Show Changes in Each Commit
git log -p
Shows the exact lines that changed in each commit. (Press q to quit)
Show Statistics
git log --stat
Shows how many lines changed in each commit.
Pretty Formatting
git log --oneline --graph --all --decorate
Shows a fancy formatted view with branches (we'll learn about branches tomorrow!).
Practice Exercise: Create a Diverse Commit History
Make at least 3 more commits today by:
Commit 1: Add a new section to index.html about universities in Uganda
git add index.html
git commit -m "Add information about Ugandan universities"
Commit 2: Create a new file companies.md with information about tech companies
git add companies.md
git commit -m "Add list of major tech companies in Uganda"
Commit 3: Update about.txt with more details
git add about.txt
git commit -m "Update project description with more details"
View Your Complete History
git log --oneline
You should have at least 6+ commits now!
Understanding Git's Safety
One of Git's amazing features is that you can almost never lose work.
- Even if you delete a file, Git has a copy
- Even if you go back in history, previous versions are safe
- Even if you make mistakes, there's usually a way to recover
The commits you've made are now permanent in your repository.
End of Day 3 Checklist
Reflection Question:
Write down 2 scenarios where version control would have saved you time in a previous school project.
THURSDAY: GitHub & Remote Repositories
1. Understanding GitHub (30 minutes)
So far, your Git repository exists only on your computer.
GitHub is a website (owned by Microsoft) where you can:
- Upload your repositories to the cloud
- Share code with others
- Collaborate on projects
- Show your work to employers
- Backup your code
Think of it like this:
- Your Computer = Your local workspace
- GitHub = Your code's home on the internet (backup + portfolio)
Why GitHub Matters
- Backup: If your computer crashes, your code is safe on GitHub
- Collaboration: Your team can access and work on your code
- Portfolio: Employers see your GitHub to evaluate your skills
- Open Source: Contribute to projects like Firefox, VS Code, Python
- It's the industry standard: Every professional uses GitHub
2. Creating a GitHub Account (15 minutes)
⚠️ IMPORTANT: Your GitHub Username is Your Career Identity
Before you create an account, read this carefully.
Your GitHub username is NOT just a login. It's your professional brand. Here's why:
This username will:
- Appear on every project you ever build
- Be in every pull request you submit
- Show on your resume and portfolio
- Be visible to potential employers who review your work
- Follow you for your ENTIRE developer career
- Be part of every link to your code (e.g.,
github.com/YOUR-USERNAME/project)
Real talk: If you create a silly, unprofessional, or immature username today, you'll be stuck explaining it for the next 20+ years of your career.
You might think: "It's just a username, I can change it later."
Truth: You CAN change it technically, but:
- All your old links break
- Projects lose their URLs
- You confuse anyone who's seen your work
- You look unprofessional
Scenario from Uganda's tech scene:
Imagine this happens in 2030:
- You've built amazing apps
- Your GitHub has 5,000 followers
- Jumia Uganda, Pesalink, or MTN sees your work
- HR manager Googles your name
- They find:
xXcoder420Xx as your GitHub profile
What they think:
- ❌ Immature
- ❌ Not serious about career
- ❌ Won't look professional at company
Contrast with:
- ✅
joannah-kuteesa - Clear, professional, memorable
- ✅
jordan-kaweesi-dev - Shows it's dev-focused
- ✅
jmulungi - Initials + name, simple and professional
Choosing Your Username Wisely
Think about it like this:
When you graduate and apply for your first tech job:
- Your future employer will search your GitHub
- They'll see your username first
- It's their first impression of your professionalism
- This affects whether you get the job
Your username should:
- Include your name - Make it about YOU, not an alter ego
- Be pronounceable - People should be able to say it out loud
- Be memorable - Easy for others to find and share
- Be professional - Something you'd write on a business card
- Be unique to you - Not generic terms everyone uses
Step 1: Go to GitHub
Visit false
Step 2: BEFORE You Sign Up - Choose Your Username
Take 5 minutes to decide. This matters.
Brainstorm some options:
For Joannah Kuteesa:
joannah-kuteesa ✅ Best
joannah-k ✅ Good (shorter)
joannahk-dev ✅ Good (shows dev focus)
xXJoannahXx ❌ No (too many decorations)
coder123 ❌ No (could be anyone)
joannah420 ❌ No (immature)
For Jordan Mulungi Kaweesi:
jordan-kaweesi ✅ Best
jordan-mulungi ✅ Good (full middle name)
jkaweesi ✅ Good (initials)
JordanDev2026 ❌ No (dated, looks desperate)
CoderFromUganda ❌ No (too generic)
jordanMLG ❌ No (unclear, looks like gamer tag)
Step 3: Click "Sign up"
You should see a form asking for:
- Email address (use your personal email - preferably professional, not "epicgamer@...")
- Password (make it strong)
- Username (this will be public - choose wisely, you're stuck with it)
Username Guidelines for Uganda's Context
Uganda's best developers have GitHub usernames like:
ebenezer-boateng - Clear, professional
collins-musyoka - Professional, memorable
amos-kipchoge-dev - Adds context (dev)
slyBrian - Short, professional, personal
NOT like:
SupremeGamer2020 - Immature, dated
l33tCoder - Looks like 1990s hacker fiction
randomkid123 - Forgettable
xxx420xxx - Career suicide
Real-World Consequences
Story from Kampala's tech community:
A developer created GitHub username HotShotCoder666 in 2018. By 2023:
- He's an excellent engineer
- Built amazing products
- But when Jumia's HR searched his name...
- First result:
HotShotCoder666
- They hired someone else
He's now trying to rebrand online, but all his work is connected to that username.
Don't be that person.
Your Decision (Make It Now)
Write down 3 username options you're considering:
Option 1: ________________
Option 2: ________________
Option 3: ________________
Which one would you write on your resume? ← That's the one to use.
Ask yourself:
- Would I be embarrassed to say this in a job interview? If yes, don't use it.
- Is this something 40-year-old me would be proud of? If no, don't use it.
- Would my future team members respect this? If no, don't use it.
Step 4: Complete Account Creation
Once you've decided on a professional username:
You should see a form asking for:
- Email address (use your personal email)
- Password (make it strong)
- Username (your carefully chosen, professional username)
Example Usernames
- Good:
joannah-kuteesa or joannah-k-dev
- Good:
jordan-kaweesi or jordan-mulungi-dev
- Bad:
xXcoder420Xx or asdfgh123
- Bad:
SillyGameNamer2020
Step 3: Verify Your Email
GitHub will send you an email. Click the verification link.
Step 4: Complete Setup
Answer a few questions about your interests. You can skip these if you want.
Congratulations! You now have a GitHub account! 🎉
3. Creating Your First Remote Repository (20 minutes)
Now let's create a repository on GitHub to receive your code.
Step 1: Click the "+" Icon
In the top-right corner of GitHub, click the + icon and select "New repository"
Step 2: Fill in the Details
- Repository name:
MyFirstRepo (or any name you like)
- Description: "My first Git repository - Learning version control"
- Public or Private: Select "Public" (so employers can see it)
- Initialize with README: Leave unchecked (we already have commits)
Step 3: Create Repository
Click "Create repository"
You'll see a page with instructions. Keep this page open - we'll use it next.
4. Connecting Your Local Repo to GitHub (20 minutes)
This is the crucial step: linking your computer's Git repo to GitHub.
Step 1: Copy the Remote URL
On the GitHub page you just created, you should see something like:
https://github.com/YOUR-USERNAME/MyFirstRepo.git
Copy this URL (it's unique to your repository).
Step 2: Add the Remote
In Terminal/Command Prompt (in your MyFirstRepo folder), run:
git remote add origin https://github.com/YOUR-USERNAME/MyFirstRepo.git
Replace YOUR-USERNAME with your actual GitHub username and MyFirstRepo with your actual repository name.
What this means:
git remote = Manage remote repositories
add = Add a new remote
origin = The name of this remote (standard convention)
- The URL = Where the remote is located
Step 3: Verify the Remote
git remote -v
You should see:
origin https://github.com/YOUR-USERNAME/MyFirstRepo.git (fetch)
origin https://github.com/YOUR-USERNAME/MyFirstRepo.git (push)
Great! Your computer now knows where to send your code.
5. Pushing Your Code to GitHub (20 minutes)
Now let's upload all your commits from your computer to GitHub.
Step 1: Push Your Commits
git push -u origin master
Breaking this down:
git push = Send commits to remote repository
-u = Set up tracking (remember this remote for future pushes)
origin = Which remote (we set this up as GitHub)
master = Which branch (we'll learn more tomorrow)
Step 2: Enter Your Credentials
GitHub may ask for your credentials:
- Username: Your GitHub username
- Password: Your GitHub password (or personal access token if you have 2FA enabled)
Note: For security, GitHub now requires a "Personal Access Token" instead of your password. If you get an error, visit: false
Step 3: Success!
You should see:
Counting objects: 8, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (8/8), 1.2 KiB, done.
Total 8 (delta 0), reused 0 (delta 0)
To https://github.com/YOUR-USERNAME/MyFirstRepo.git
* [new branch] master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.
Congratulations! Your code is now on GitHub! 🎉
Step 4: Verify on GitHub.com
Go back to GitHub in your browser and refresh the page. You should see:
- Your
index.html file
- Your
about.txt file
- Your
developers.md file
- Your complete commit history!
6. Making Updates from Here On (15 minutes)
Now that your local repo is connected to GitHub, pushing is easy:
Step 1: Make a Change
Edit your index.html file and add something new.
Step 2: Stage and Commit
git add index.html
git commit -m "Add new content to index page"
Step 3: Push to GitHub
git push
Notice: No need for -u origin master anymore. Git remembers!
Repeat This Cycle
From now on, your development cycle will be:
EDIT → ADD → COMMIT → PUSH
And your code is automatically backed up on GitHub.
Uganda Context: Code Repositories in the Real World
At companies like Jumia Uganda, this is how it works:
- Developer writes code on their computer
- Developer commits their work to Git with clear messages
- Developer pushes to a GitHub repository
- Team members review the code on GitHub
- After approval, the code is merged into the main project
- New version is deployed to production (the live website)
Every day, dozens of developers push code this way at Jumia. GitHub is the central hub.
Understanding Public Repositories
Your repository is now public. This means:
✅ Good:
- Employers can see your work
- You build a portfolio
- Others can learn from your code
- This is professional
❌ Be careful not to:
- Share passwords or API keys (credentials)
- Put other people's code without credit
- Commit large files
- Include sensitive information
For future projects, if you need privacy, you can make repositories "Private" (only you see them).
End of Day 4 Checklist
Reflection Question:
Why would an employer look at your GitHub profile when hiring a developer?
FRIDAY: Branches & Collaboration
1. Understanding Branches (30 minutes)
A branch is like creating an alternate version of your project.
Why Branches?
Imagine you're working on a website:
- The main website is working perfectly (
master branch)
- You want to build a new feature (login system)
- You don't want to break the working website while developing
Solution: Create a new branch to work on the feature separately.
master branch: ● ← → ● ← → ● (live, working version)
└→ ● ← → ● (login-feature branch, experimental)
When the feature is working, you merge it back into master.
Branch Terminology
- master (or main) = The primary branch, usually the "production" version
- feature branch = A branch for developing a specific feature
- bugfix branch = A branch for fixing a specific bug
- HEAD = Your current location in the repository
2. Creating and Switching Branches (30 minutes)
Step 1: Check Your Current Branch
git branch
You should see:
* master
The * means you're currently on the master branch.
Step 2: Create a New Branch
You're going to create a branch for a new feature: "Adding a Contact Page."
git branch contact-page
This creates a new branch called contact-page, but you're still on master.
Step 3: List All Branches
git branch
Now you should see:
contact-page
* master
Step 4: Switch to the New Branch
git checkout contact-page
Or in newer Git versions:
git switch contact-page
Step 5: Verify You're on the New Branch
git branch
Now you should see:
* contact-page
master
3. Making Changes on Your Branch (30 minutes)
Now you're on the contact-page branch. Any changes you make will only affect THIS branch, not master.
Step 1: Create a New File
Create a new file called contact.html:
<!DOCTYPE html>
<html>
<head>
<title>Contact Us - Uganda Tech</title>
</head>
<body>
<h1>Contact Us</h1>
<p>Get in touch with the Uganda tech community</p>
<h2>Contact Methods</h2>
<ul>
<li>Email: contact@ugandatech.ug</li>
<li>Phone: +256 (0)1 234 5678</li>
<li>Location: Kampala, Uganda</li>
</ul>
<h2>Contact Form</h2>
<form>
<input type="text" placeholder="Your Name" required>
<input type="email" placeholder="Your Email" required>
<textarea placeholder="Your Message"></textarea>
<button type="submit">Send Message</button>
</form>
</body>
</html>
Step 2: Update index.html
Add a link to the contact page in your index.html:
<p><a href="contact.html">Contact Us</a></p>
Step 3: Stage and Commit
git add .
git commit -m "Add contact page with contact form"
Step 4: Check Your Branch's Log
git log --oneline
You see the new commit on the contact-page branch.
Step 5: Switch Back to Master
git checkout master
Step 6: Check Master's Log
git log --oneline
Important: The contact.html file DOESN'T EXIST on master! The commits you made on the contact-page branch aren't here. This is the power of branches - you can work on multiple things separately.
Try:
ls
Or dir on Windows - you won't see contact.html here.
Step 7: Switch Back to Contact-Page
git checkout contact-page
Now contact.html appears again! You're back to where you were working.
4. Merging Branches (30 minutes)
After you've tested your feature and it works, you merge it back into master.
Step 1: Switch to Master
git checkout master
Step 2: Merge Contact-Page Into Master
git merge contact-page
You should see:
Updating a1b2c3d..e5f6g7h
Fast-forward
contact.html | 23 ++++++++++++++
index.html | 1 +
2 files changed, 24 insertions(+)
create mode 100644 contact.html
Step 3: Verify the Files
ls
Now you should see contact.html on the master branch!
Step 4: Check the Log
git log --oneline
You see all commits, including the one from the contact-page branch. They're now part of master's history.
Step 5: Clean Up - Delete the Old Branch
Once a branch is merged, you can delete it:
git branch -d contact-page
The branch is gone, but all its commits are preserved in master.
5. Collaboration Basics (30 minutes)
Git allows teams to work together. Here's how:
Scenario: You and Your Team Member
The Setup:
- You and your team member both have the same repository
- You each work on different features in different branches
- You both push to GitHub
- Your code gets combined
Step 1: Create a New Branch for a Feature
git checkout -b newsletter-feature
This creates AND switches to a new branch in one command.
Step 2: Make Some Changes
Add content to a new file newsletter.md:
# Newsletter Signup
We want to build a newsletter feature for our Uganda Tech website.
## Features
- Email signup form
- Monthly newsletter about Uganda's tech scene
- Unsubscribe option
## Technologies
- Email service: AWS SES or Mailgun
- Database: Store emails securely
- Encryption: Protect user data
Step 3: Commit and Push
git add newsletter.md
git commit -m "Plan newsletter feature"
git push -u origin newsletter-feature
Important: -u origin newsletter-feature tells GitHub to track this new branch.
Step 4: Check GitHub
Go to GitHub.com and refresh. You should see:
- Your repository now has a
newsletter-feature branch
- GitHub shows your new file
Step 5: On GitHub, Create a Pull Request (Simulation)
On GitHub, you'd normally click "New Pull Request" to ask for your team member to review your work. But for now, you can manually merge:
git checkout master
git merge newsletter-feature
git push
Now your master branch on GitHub has the newsletter changes.
6. Best Practices for Branches (15 minutes)
Here's how professional teams use branches:
Branch Naming Conventions
Professional teams name branches clearly:
feature/login-system - Adding a new feature
bugfix/fix-validation - Fixing a bug
hotfix/critical-issue - Urgent production fix
docs/update-readme - Documentation updates
refactor/optimize-queries - Code improvements
Example Workflow
Create a feature branch:
git checkout -b feature/ugandan-payment-integration
Do your work:
git add .
git commit -m "Integrate Pesalink payment option"
git commit -m "Add MTN Mobile Money integration"
Push to GitHub:
git push -u origin feature/ugandan-payment-integration
Team reviews on GitHub
Merge to master:
git checkout master
git pull origin master # Get latest changes
git merge feature/ugandan-payment-integration
git push
Delete the feature branch:
git branch -d feature/ugandan-payment-integration
7. Pulling Changes from GitHub (15 minutes)
If your team member pushed code to GitHub, here's how you get their changes:
git pull
This does two things:
git fetch - Downloads changes from GitHub
git merge - Combines those changes with your local code
8. Understanding Conflicts (10 minutes - Advanced)
Merge conflicts happen when you and your teammate edited the same line differently.
Example: You both edited index.html's title:
- Your version:
<title>Uganda Tech Community</title>
- Their version:
<title>East Africa's Tech Hub</title>
Git can't choose, so it marks the conflict in the file:
<<<<<<< HEAD
<title>Uganda Tech Community</title>
=======
<title>East Africa's Tech Hub</title>
>>>>>>> newsletter-feature
Solution: Open the file, decide which version you want (or combine them), then commit.
For today, just know conflicts exist. You'll learn to handle them in Week 2 when you work with your team.
Practical Exercise: Complete Workflow
Do this entire workflow one more time to practice:
Create a branch:
git checkout -b feature/events-page
Create a new file events.md:
# Uganda Tech Events
## September 2026
- Sept 5: Kampala Dev Meetup
- Sept 12: Mobile Development Workshop
- Sept 19: Data Science Bootcamp
## October 2026
- Oct 3: Annual Tech Conference
- Oct 10: Hackathon
Commit:
git add events.md
git commit -m "Add events page with upcoming tech events"
Push:
git push -u origin feature/events-page
Merge back to master:
git checkout master
git merge feature/events-page
Delete the branch:
git branch -d feature/events-page
Push to GitHub:
git push
Uganda Context: Real Teams Using Branches
At Jumia Uganda's development team:
- Master branch = Live production code (stable)
- develop branch = Testing branch (latest features)
- feature branches = Individual developers work here
feature/payment-redesign
feature/mobile-optimization
feature/new-categories
- bugfix branches = Quick fixes
bugfix/checkout-error
bugfix/login-timeout
Each developer works on their own branch, pushes to GitHub, and the team reviews before merging.
End of Week 1 Summary
What You've Learned:
✅ Git Basics
- Installing and configuring Git
- Creating repositories
- Making commits with meaningful messages
- Viewing commit history
✅ GitHub Integration
- Creating GitHub accounts and repositories
- Pushing code to GitHub
- Understanding remote repositories
- Backing up your code in the cloud
✅ Collaboration
- Creating and switching branches
- Merging branches
- Understanding pull requests
- Best practices for team development
✅ Professional Workflows
- Staging changes before committing
- Writing clear commit messages
- Using branches for features
- Pushing to share code
Your Week 1 Checklist:
Homework for This Weekend
Task 1: Explore Your Own Work
On GitHub, go to your repository. Browse through:
- Your files
- Your complete commit history
- The changes in each commit
Task 2: Reflect and Document
Create a file called WEEK-1-REFLECTION.md with:
# Week 1 Reflection - Git & GitHub
## What I Learned
-
## Most Useful Concept
-
## One Challenge I Had
-
## How I'd Use This in a Team
-
## Questions for Next Week
-
Fill this out honestly - your coach wants to know what made sense and what was confusing.
Task 3: Clean Up Your Repo
- Remove test files you created during practice
- Add these files to a commit:
git add . then git commit -m "Clean up test files"
- Push to GitHub:
git push
Vocabulary Learned This Week
| Term |
Meaning |
| Repository |
A folder tracked by Git containing your project |
| Commit |
A saved snapshot of your code with a message |
| Branch |
An independent version of your code for separate development |
| Merge |
Combining two branches together |
| Remote |
A copy of your repository on another computer (GitHub) |
| Push |
Uploading commits to GitHub |
| Pull |
Downloading commits from GitHub |
| Staging Area |
Files selected for the next commit |
| HEAD |
Your current location in the repository |
| Clone |
Downloading a repository from GitHub |
Common Git Commands Reference
# Setup
git config --global user.name "Your Name"
git config --global user.email "your@email.com"
# Create & Commit
git init # Create new repository
git add file.txt # Stage file
git add . # Stage all files
git commit -m "Message" # Commit with message
git status # See what's changed
git diff # See exact changes
# History
git log # Full commit history
git log --oneline # Short commit history
git log -p # Show changes in commits
# Branches
git branch # List branches
git branch name # Create branch
git checkout name # Switch to branch
git merge name # Merge branch into current
git branch -d name # Delete branch
# Remote & GitHub
git remote add origin URL # Connect to GitHub
git push # Upload to GitHub
git pull # Download from GitHub
git clone URL # Download entire repository
# Undo
git checkout file # Discard changes
git reset file # Unstage file
git commit --amend # Change last commit message
Week 2 Preview
Next week: HTML & HTML Tags
You'll:
- Learn what HTML is and why it matters
- Master every common HTML tag
- Build multi-page websites
- Make daily commits to GitHub with your team member
- Add David Emiru Egwell (makanika) as a collaborator
- Practice the Git workflow you learned this week
Come ready to code!
End of Week 1: Git & GitHub Fundamentals
Created with ❤️ for Uganda's next generation of developers