2025-02-14 Programming, Productivity
Git & GitHub for Real-World Development
By O. Wolfson
📌 Module 1: Introduction to Git & Version Control
- What is Version Control? Why does it matter in production?
- Git vs. GitHub vs. GitLab vs. Bitbucket (When to use each)
- Centralized vs. Distributed Version Control
- Installing Git (Windows/macOS/Linux)
- Configuring Git (
git config --global user.name "Your Name"
, etc.)
🔹 Hands-on Exercise: Install and configure Git, set up SSH keys for GitHub.
📌 Module 2: Understanding the Git Workflow
- Working Directory, Staging Area, and Repository (How Git actually works)
- Creating a New Repository (
git init
) - Tracking Files & Making Commits (
git add
,git commit
) - Viewing Changes (
git status
,git diff
) - Understanding Commit History (
git log
,git show
)
🔹 Hands-on Exercise: Create a new repo, track changes, and commit with meaningful messages.
📌 Module 3: Undoing Changes & Recovering Lost Work
- Reverting to Previous Versions
git checkout <commit>
(temporary switch)git reset --hard <commit>
(permanently go back)git revert <commit>
(safe rollback without losing history)
- Undoing Commits & Changes
git reset --soft HEAD~1
(undo last commit but keep changes)git reset --hard HEAD~1
(undo last commit and discard changes)git restore
(discard uncommitted changes safely)
- Recovering Lost Commits (
git reflog
)
🔹 Hands-on Exercise: Simulate accidental deletions and recover using git reflog
.
📌 Module 4: Working with Branches & Merging
- Why Branching is Critical for Teamwork
- Creating and Switching Branches (
git branch
,git checkout
,git switch
) - Merging Branches (
git merge
) & Dealing with Merge Conflicts - Fixing Merge Conflicts Like a Pro (
<<<<<<<
,=======
,>>>>>>>
) - When to Use Fast-Forward vs. Non-Fast-Forward Merging
🔹 Hands-on Exercise: Create feature branches, merge them, and resolve merge conflicts.
📌 Module 5: GitHub for Collaboration & Teamwork
- GitHub vs. Local Git: How They Work Together
- Creating a GitHub Repo & Pushing Code (
git push origin main
) - Cloning a Repository (
git clone
) - Pulling Latest Changes (
git pull
) - Understanding
git fetch
vs.git pull
🔹 Hands-on Exercise: Push a local project to GitHub and collaborate.
📌 Module 6: Pull Requests & Code Reviews
- What are Pull Requests? Why Are They Essential?
- How to Fork a Repo & Contribute to Open Source
- Making a Pull Request (PR)
- Reviewing and Approving PRs
- Best Practices for Code Reviews & Team Collaboration
🔹 Hands-on Exercise: Fork a repo, make changes, submit a PR, and review another PR.
📌 Module 7: Advanced Git for Production & Troubleshooting
- Stashing Work (
git stash
) to Temporarily Save Changes - Cherry-Picking Commits (
git cherry-pick <commit>
) - Interactive Rebase (
git rebase -i HEAD~N
) - Squashing Commits Before Merging
- Fixing Mistakes with
git commit --amend
- The Dangers of
git push --force
(and how to recover if used wrong)
🔹 Hands-on Exercise: Rebase, squash, and cherry-pick commits in a real project.
📌 Module 8: Debugging with Git & Finding Who Broke the Code
- Using
git blame
to Find Who Changed What - Finding the Commit That Introduced a Bug (
git bisect
) - Rolling Back a Production Bug Fix (
git revert
vs.git reset
) - Debugging Broken Merges (
git merge --abort
)
🔹 Hands-on Exercise: Use git bisect
to track down a bug in a project.
📌 Module 9: Handling Large Repos & Performance Optimization
- Cloning Only Necessary Parts of a Repository (
git clone --depth=1
) - Using
.gitignore
to Improve Speed and Reduce Clutter - Git LFS (Large File Storage) for Handling Media & Large Binaries
- Cleaning Up Old and Unused Branches (
git branch -d
&git branch -D
)
🔹 Hands-on Exercise: Optimize a bloated Git repo for better performance.
📌 Module 10: Automating Git with GitHub Actions
- Introduction to GitHub Actions for CI/CD
- Running Automated Tests Before Merging PRs
- Deploying Code to Production from GitHub
- Creating Custom Workflows with GitHub Actions
🔹 Hands-on Exercise: Set up a GitHub Actions workflow for automated testing.
📌 Final Project: Real-World Git & GitHub Workflow
🎯 Goal: Apply everything learned in a real-world team setting.
✅ Work on a team project with feature branches
✅ Implement pull requests & code reviews
✅ Resolve conflicts & debug issues
✅ Set up GitHub Actions for automation
✅ Optimize Git history before merging to main
📌 Bonus Module: Open Source & Git Best Practices
- How to Find Open Source Projects to Contribute To
- Understanding Open Source Licensing (MIT, GPL, Apache, etc.)
- How to Structure a Good Open Source Repository
- Using GitHub Discussions & Issues for Community Collaboration
🔹 Hands-on Exercise: Make your first real open-source contribution.
💡 Why This Course Stands Out
✅ Covers not just theory but real-world production use cases
✅ Teaches troubleshooting for common Git mistakes and recovery
✅ Focuses on critical fixes for saving projects in emergencies
✅ Includes team collaboration workflows for companies and open source
✅ Equips learners with automation and CI/CD tools using GitHub Actions
🔥 Final Thoughts With this enhanced course, learners will not only understand Git & GitHub basics but also master the tools needed to handle critical production issues, work in teams, and set up automation for efficient workflows. 🚀