Weeks 1–2: Git Fundamentals and Branching
Weeks 1–2: Git Fundamentals and Branching
Duration: 80 hours (2 weeks × 5 days × 8 hours)
Level: Graduate/Entry-level
Mode: Full-time immersive training
Weeks 1–2 Overview
Master Git fundamentals, local workflows, remote collaboration, and branching strategies. By end of week, you’ll work confidently with Git in team environments.
##Day 1: Setup and Local Workflows (8 hours)
###Morning Session (9:00 AM - 12:30 PM)
####9:00 - 10:30: Introduction and Setup (1.5 hrs) Module: 01-setup-and-basics.md
- Course introduction and expectations
- Git installation verification
- Global configuration (name, email, default branch)
- Understanding Git’s three-area model
- Initialize first repository
Lab 1.1: Setup and First Repository (30 mins)
- Configure Git with personal details
- Create
git_practicedirectory - Initialize repository
- Create and track first file
####10:30 - 10:45: Break
####10:45 - 12:30: Local Workflow Fundamentals (1.75 hrs) Module: 02-local-workflow.md
- Stage and commit workflow
- Viewing differences:
git diffvsgit diff --staged - Commit history with
git log - Introduction to .gitignore
Lab 1.2: Complete Commit Workflow (45 mins)
- Make multiple commits to same file
- View and compare changes
- Create .gitignore for temporary files
- Practice different log formats
####12:30 - 1:30 PM: Lunch Break
###Afternoon Session (1:30 PM - 5:00 PM)
####1:30 - 2:00: vi Editor Quick Start (30 mins) Module: 03-vi-quick-guide.md
- Why vi matters for developers
- Essential vi commands
- Modes: Normal, Insert, Command-line
- Hands-on practice session
Lab 1.3: vi Practice (30 mins)
- Create and edit files using only vi
- Practice navigation and editing
- Write commit messages in vi
####2:00 - 3:30: Fixing Common Mistakes (1.5 hrs) Module: 04-fixing-mistakes.md
- Unstaging files:
git reset HEAD - Uncommitting changes:
git reset --soft - Understanding reset modes: soft vs hard
- Modern alternatives:
git restore
Lab 1.4: Mistake Recovery Scenarios (45 mins)
- Intentionally stage wrong files
- Practice unstaging
- Commit wrong file and undo safely
- Use reflog to see HEAD movements
####3:30 - 3:45: Break
####3:45 - 5:00: Day 1 Comprehensive Lab (1.25 hrs)
Project 1.1: Personal Portfolio Repository
- Create a portfolio project structure
- Add multiple files (README, index.html, style.css)
- Make logical commits with clear messages
- Use .gitignore for temp files
- Intentionally make and fix 2 mistakes
- Document your workflow in NOTES.md
Deliverables:
- Repository with 5+ meaningful commits
- Clean working directory
- Proper .gitignore
- NOTES.md documenting what you learned
##Day 2: Remote Collaboration (8 hours)
###Morning Session (9:00 AM - 12:30 PM)
####9:00 - 9:30: Day 1 Recap and Q&A (30 mins)
- Review key concepts from Day 1
- Common issues discussion
- Quick quiz on basic commands
####9:30 - 11:00: Remote Repository Fundamentals (1.5 hrs) Module: 05-remote-collaboration.md
- Understanding remote repositories
- GitHub vs GitLab overview
- SSH vs HTTPS authentication
- Adding remote:
git remote add origin - First push:
git push -u origin main - Understanding upstream tracking
Lab 2.1: Connect to GitHub (45 mins)
- Create GitHub account (if needed)
- Create empty remote repository
- Connect local Day 1 project to remote
- Push all commits
- Verify on GitHub web interface
####11:00 - 11:15: Break
####11:15 - 12:30: Fetch, Pull, and Sync (1.25 hrs)
- Difference between fetch and pull
- Remote tracking branches
- Viewing remote changes before pulling
- Handling divergent branches
- Push rejected scenarios
Lab 2.2: Simulating Team Work (45 mins)
- Add commits via GitHub web interface
- Use
git fetchto see remote changes - Use
git diffto compare local vs remote - Pull changes and verify sync
- Practice the fetch-diff-pull workflow
####12:30 - 1:30 PM: Lunch Break
###Afternoon Session (1:30 PM - 5:00 PM)
####1:30 - 3:00: Clone and Team Collaboration (1.5 hrs)
- Cloning repositories:
git clone - Forking workflow on GitHub
- Working with multiple remotes
- Keeping fork synchronized with upstream
Lab 2.3: Clone and Collaborate (1 hour)
- Clone a public repository
- Make local changes
- Push to your fork
- Add upstream remote
- Sync with upstream changes
####3:00 - 3:15: Break
####3:15 - 5:00: Day 2 Project (1.75 hrs)
Project 2.1: Team Wiki Simulation
- Create a “team-wiki” repository
- Push initial structure to GitHub
- Add content via web interface (simulating teammate)
- Pull and add more local content
- Practice full remote workflow 10+ times
- Document common scenarios in wiki
Deliverables:
- Repository on GitHub with 10+ commits
- Mix of local and remote-first changes
- Demonstrates fetch-diff-pull workflow
- Wiki page documenting the workflow
End of Day: Push all work to GitHub
##Day 3: Branching Fundamentals (8 hours)
###Morning Session (9:00 AM - 12:30 PM)
####9:00 - 9:30: Day 2 Recap and Code Review (30 mins)
- Peer review of Day 2 projects
- Discuss remote workflow challenges
- Q&A session
####9:30 - 11:00: Introduction to Branching (1.5 hrs) Module: 06-branching-and-merging.md (Part 1)
- Why branches matter in team development
- Understanding branch pointers
- Creating branches:
git branch - Switching branches:
git checkoutandgit switch - Shortcut:
git checkout -b branch-name - Viewing all branches:
git branch -a
Lab 3.1: First Branches (45 mins)
- Create 3 feature branches
- Switch between branches
- Make commits on different branches
- Observe file differences when switching
- Use
git log --graphto visualize
####11:00 - 11:15: Break
####11:15 - 12:30: Basic Merging (1.25 hrs)
- Fast-forward merges
- Three-way merges
- Merge commit messages
- Deleting merged branches
- Branch naming conventions
Lab 3.2: Merge Practice (45 mins)
- Create feature branch
- Make multiple commits
- Merge back to main
- Delete feature branch
- Repeat with 3 different features
####12:30 - 1:30 PM: Lunch Break
###Afternoon Session (1:30 PM - 5:00 PM)
####1:30 - 2:30: Remote Branches (1 hour)
- Pushing branches to remote
- Tracking remote branches
- Fetching remote branches
- Deleting remote branches
- Branch protection rules (overview)
Lab 3.3: Remote Branch Workflow (45 mins)
- Create local branch
- Push to remote with upstream tracking
- Make changes and push
- View branch on GitHub
- Delete local and remote branches
####2:30 - 2:45: Break
####2:45 - 5:00: Day 3 Project (2.25 hrs)
Project 3.1: Feature Development Simulation Create a simple website project with feature branches:
Base Setup:
- Repository:
website-project - main branch with basic HTML structure
Features to Implement(each on separate branch):
feature-header: Add navigation headerfeature-footer: Add footer with linksfeature-about: Create about pagefeature-contact: Create contact formfeature-styles: Add CSS styling
Requirements:
- Create each feature on separate branch
- Make 2-3 commits per feature
- Merge to main one at a time
- Push each merged feature
- Delete branches after merging
- Use proper commit messages
Deliverables:
- GitHub repository with clean main branch
- 5 completed and merged features
- Clean branch list (no leftover feature branches)
- Linear history (fast-forward merges)
##Day 4: Merge Conflicts and Resolution (8 hours)
###Morning Session (9:00 AM - 12:30 PM)
####9:00 - 9:30: Day 3 Recap and Branch Review (30 mins)
- Review Day 3 projects
- Discuss branching strategies
- Common branching mistakes
####9:30 - 11:30: Understanding Merge Conflicts (2 hrs) Module: 06-branching-and-merging.md (Part 2)
- What causes merge conflicts
- Conflict markers:
<<<<<<<,=======,>>>>>>> - Reading conflict indicators
- Strategies for resolution
- Tools for conflict resolution
Demo: Live conflict creation and resolution (30 mins)
Lab 4.1: Intentional Conflicts (1 hour)
- Create conflicting changes on two branches
- Attempt merge
- Read and understand conflict markers
- Resolve conflicts manually
- Complete merge commit
- Repeat 5 times with different scenarios
####11:30 - 11:45: Break
####11:45 - 12:30: Advanced Conflict Scenarios (45 mins)
- Multiple file conflicts
- Binary file conflicts
- Choosing merge strategies
- Using
git mergetool - Aborting merges:
git merge --abort
Lab 4.2: Complex Conflicts (30 mins)
- Create conflicts in 3 files simultaneously
- Resolve one at a time
- Verify resolution with tests
- Complete merge
####12:30 - 1:30 PM: Lunch Break
###Afternoon Session (1:30 PM - 5:00 PM)
####1:30 - 3:00: Team Conflict Resolution Simulation (1.5 hrs)
Lab 4.3: Pair Programming - Conflict Resolution
- Pair up with another student
- Both modify same files
- Take turns merging and resolving
- Practice communication during conflicts
- Document resolution strategies
####3:00 - 3:15: Break
####3:15 - 5:00: Day 4 Project (1.75 hrs)
Project 4.1: Collaborative Blog Platform
Scenario: Two team members (you playing both roles) work on same blog.
Setup:
- Create
blog-platformrepository - Initial structure with blog posts
Conflict Scenarios to Practice:
- Both edit same blog post intro
- Both add images to same section
- Both modify same CSS rules
- Both update same config file
- Both edit same JavaScript function
Requirements:
- Create each conflict intentionally
- Document conflict before resolving
- Resolve each conflict correctly
- Test that resolved code works
- Write CONFLICT-RESOLUTION-LOG.md documenting each conflict and solution
Deliverables:
- Repository with 5 resolved merge conflicts
- CONFLICT-RESOLUTION-LOG.md with:
- What caused each conflict
- How you resolved it
- Lessons learned
- All conflicts properly resolved and merged
Day 5: Project and Assessment (8 hours)
###Morning Session (9:00 AM - 12:30 PM)
####9:00 - 10:00: Week 1 Review (1 hour)
- Recap Days 1-4
- Key concepts review
- Command cheat sheet review
- Best practices discussion
- Q&A session
Module: 08-cheatsheet-and-practice.md
####10:00 - 10:15: Break
####10:15 - 12:30: Week 1 Assessment (2.25 hrs)
Written Assessment(45 mins): Module: 09-student-worksheet.md
- Complete all sections
- Command recall
- Concept understanding
- Scenario-based questions
Practical Assessment(1.5 hrs): Individual tasks performed under observation:
- Initialize repository and make 5 commits
- Create and merge 2 branches
- Intentionally create and resolve merge conflict
- Push and sync with remote
- Use vi to edit commit messages
####12:30 - 1:30 PM: Lunch Break
###Afternoon Session (1:30 PM - 5:00 PM)
####1:30 - 4:30: Week 1 Capstone Project (3 hrs)
Project 1.1: Task Management Application
Requirements: Build a simple task management system from scratch using proper Git workflow.
Specifications:
- Repository:
task-manager-v1 - Must have README with setup instructions
- HTML structure for task list
- CSS for styling
- JavaScript for basic functionality
- Use proper .gitignore
Git Workflow Requirements:
- Start from initialized repository
- Create these branches and features:
feature-html-structure: Basic HTML layoutfeature-css-design: Styling and responsive designfeature-add-task: JavaScript to add tasksfeature-delete-task: JavaScript to delete tasksfeature-filter-tasks: Filter completed/active tasks
- Each feature must:
- Be developed on separate branch
- Have minimum 3 meaningful commits
- Be merged to main via proper merge
- Be pushed to GitHub after merging
-
Create at least 2 intentional merge conflicts and resolve them
- Throughout development:
- Commit frequently with clear messages
- Use git status before every commit
- Push after every feature completion
- Maintain clean working directory
Deliverables:
- GitHub repository with complete project
- Minimum 20 commits with clear messages
- Clean git history showing all feature branches
- Working task manager (doesn’t need to be perfect)
- DEVELOPMENT-LOG.md documenting:
- Each feature branch created
- Conflicts encountered and resolutions
- Git commands used
- Challenges faced
####4:30 - 5:00: Week 1 Wrap-up (30 mins)
- Project demonstrations (volunteers)
- Week 1 feedback collection
- Weeks 3–4 preview
- Individual feedback sessions
Weeks 1–2 Learning Outcomes
By end of Weeks 1–2, you should be able to:
Setup and Configuration- Install and configure Git
- Set up SSH keys for GitHub
- Configure global and local settings
Local Git Operations- Initialize repositories
- Stage and commit changes
- View diffs and history
- Use .gitignore effectively
- Undo mistakes safely
Remote Collaboration- Connect to remote repositories
- Push and pull changes
- Use fetch to preview changes
- Clone repositories
- Handle push rejections
Branching and Merging- Create and switch branches
- Merge branches (fast-forward and three-way)
- Push and track remote branches
- Delete local and remote branches
Conflict Resolution- Understand conflict markers
- Resolve merge conflicts manually
- Use conflict resolution strategies
- Test resolved code
- Complete merge commits
Professional Practices- Write clear commit messages
- Commit frequently and logically
- Use git status as safety check
- Maintain clean working directory
- Follow branch naming conventions
##Daily Homework (Optional but Recommended)
Day 1: Create personal GitHub profile README
Day 2: Clone and explore 2 open source projects
Day 3: Create a branch strategy diagram for your capstone project
Day 4: Document 3 real-world conflict scenarios
Day 5: Write reflection on Week 1 learning
##Resources for Week 1
- Pro Git Book - Chapters 1-3
- GitHub Guides
- Git Cheat Sheet
- Oh My Git! Game - Practice branching
##Success Criteria
To pass Week 1:
- Complete all daily labs
- Pass written assessment (70%+)
- Pass practical assessment
- Submit Week 1 capstone project
- Demonstrate proficiency in:
- Basic Git operations
- Branching and merging
- Conflict resolution
- Remote collaboration
Next: WEEK-2-CURRICULUM.md - Weeks 3–4: Advanced Workflows and Team Collaboration