Git & GitHub – 100+ Lab Exercises (Basic, Intermediate, Advanced)

🔰 Basic Level (30+ Exercises)

 

Goal: Establish foundational skills in version control, Git commands, and basic GitHub usage.

 

Core Git Concepts & Commands

  • Initialize a Git repository (git init).

  • Clone a remote repository (git clone).

  • Understand Git staging area (git add).

  • Commit changes with descriptive messages (git commit).

  • Check repository status (git status).

  • View commit history (git log).

  • Understand the difference between working directory, staging area, and repository.

  • Create and switch branches (git branch, git checkout).

  • Track new files and ignore files using .gitignore.

GitHub Essentials

  • Create a GitHub account and repository.

  • Push local commits to GitHub (git push).

  • Pull remote changes (git pull).

  • Fork a repository and clone the fork.

  • Open and manage issues on GitHub.

  • Make simple pull requests (PRs) and understand the workflow.

  • Use GitHub Pages for basic static site hosting.

  • Understand the importance of README.md and write basic documentation.

Practice Exercises

  • Initialize a Git repository and make initial commits for a sample project.

  • Clone an open-source GitHub repo and explore its history.

  • Practice branching and merging on a test repo.

  • Simulate and resolve merge conflicts manually.

  • Push code updates and create a pull request on a forked repo.


 

🚀 Intermediate Level (40+ Exercises)

 

Goal: Enhance proficiency with Git workflows, collaboration, and intermediate GitHub features.

 

Git Branching & Merging

  • Work with remote branches (git fetch, git remote).

  • Create feature branches and merge using fast-forward and no-fast-forward.

  • Rebase feature branches (git rebase) and resolve conflicts.

  • Use git stash to temporarily save work.

  • Cherry-pick commits from one branch to another.

  • Undo commits safely (git revert, git reset).

Collaboration & Workflow

  • Fork, clone, and sync upstream repositories.

  • Manage pull requests with review comments.

  • Use GitHub Actions for simple CI/CD pipelines.

  • Utilize protected branches and branch policies.

  • Use GitHub Projects and Issues for agile task management.

  • Manage releases and tags (git tag).

  • Collaborate using GitHub Discussions and Wikis.

  • Automate workflows with GitHub templates and bots.

Practice Exercises

  • Implement Git Flow branching model on a team project.

  • Set up a simple CI workflow using GitHub Actions.

  • Perform an interactive rebase to clean commit history.

  • Collaborate on a repository using forks, branches, and pull requests.

  • Tag and create a release on GitHub with changelog updates.


 

🧠 Advanced Level (40+ Exercises)

 

Goal: Master advanced Git/GitHub techniques, automation, and enterprise-grade workflows.

 

Advanced Git Techniques

  • Deep dive into Git internals: objects, refs, and reflog.

  • Use git bisect to find faulty commits.

  • Implement submodules and manage nested repositories.

  • Perform large repository optimization (git gc, git prune).

  • Use Git hooks for automation (pre-commit, post-commit).

  • Advanced conflict resolution strategies in complex merges.

  • Manage sparse checkouts and partial clones.

Enterprise & Automation

  • Configure branch protection rules and mandatory PR reviews.

  • Manage organizational repositories and teams on GitHub Enterprise.

  • Automate workflows using advanced GitHub Actions (testing, deployment).

  • Implement semantic versioning with automated tagging.

  • Integrate GitHub with third-party tools (Slack, Jira, Jenkins).

  • Manage secrets and environment variables securely in GitHub Actions.

  • Perform disaster recovery using reflog and stash.

Practice Exercises

  • Automate a multi-stage CI/CD pipeline using GitHub Actions.

  • Simulate and recover from complex merge conflicts in a large repo.

  • Set up and use Git submodules for shared libraries.

  • Use git bisect to track down a regression bug.

  • Configure and enforce branch policies and PR reviews for a team.

Capstone Projects

 

  • Create and maintain an open-source project on GitHub with continuous integration.

  • Implement a full Git branching strategy for a multi-developer software project.

  • Build a GitHub Action workflow for automated testing and deployment.

  • Lead a collaborative feature development using forks, branches, and pull requests.

  • Document and automate release management processes using tags and releases.


 

Tools & Platforms

 

  • Git CLI and GUI clients (GitKraken, SourceTree)

  • GitHub web interface & GitHub Desktop

  • GitHub Actions for CI/CD

  • Integration tools: Slack, Jira, Jenkins, Docker

Scroll to Top