Git Basics
150 exercises
Practice exercises for Git.
- 1
Git Add Command Quiz
Test your understanding of what the git add command does in the Git workflow.
Multiple Choice Beginner - 2
Stage All Changes Practice
Practice using git add with the dot shortcut to stage all files at once.
Fill in the Blank Easy - 3
Understanding Git Commits
Check your conceptual understanding of what a Git commit represents.
Concept Check Beginner - 4
Spot the Git Commit Mistake
Find the error in a git commit command with a multi-word message.
Find the Mistake Easy - 5
Git Status Command Quiz
Test your knowledge of what information the git status command displays.
Multiple Choice Beginner - 6
Git Log Command Quiz
Test your understanding of what the git log command displays.
Multiple Choice Beginner - 7
Show Recent Commits Practice
Practice using git log with a flag to limit the number of commits shown.
Fill in the Blank Easy - 8
What Is Git Quiz
Test your understanding of what Git is and what problem it solves.
Multiple Choice Beginner - 9
Repository Concept Quiz
Check your understanding of what a Git repository contains.
Multiple Choice Beginner - 10
Git Init Quiz
Test your knowledge of what the git init command does.
Multiple Choice Beginner - 11
Git Clone Quiz
Test your understanding of what git clone does.
Multiple Choice Beginner - 12
Push vs Pull Quiz
Distinguish between git push and git pull.
Multiple Choice Easy - 13
Git Branch Quiz
Test your knowledge of what a branch represents in Git.
Multiple Choice Easy - 14
Git Merge Quiz
Test your understanding of what merging does.
Multiple Choice Easy - 15
Git Checkout Quiz
Test your knowledge of what git checkout does.
Multiple Choice Easy - 16
Git Stash Quiz
Test your understanding of what git stash does.
Multiple Choice Medium - 17
Git Diff Quiz
Test your knowledge of what git diff shows.
Multiple Choice Easy - 18
Git Revert Quiz
Test your understanding of what git revert does.
Multiple Choice Medium - 19
Git Reset Modes Quiz
Test your knowledge of the different git reset modes.
Multiple Choice Medium - 20
Gitignore Quiz
Test your understanding of what .gitignore does.
Multiple Choice Beginner - 21
Merge Conflict Markers Quiz
Test your knowledge of merge conflict marker syntax.
Multiple Choice Medium - 22
Git Flow Branches Quiz
Test your knowledge of the Git Flow branching model.
Multiple Choice Medium - 23
Pull Request Quiz
Test your understanding of what a pull request is.
Multiple Choice Easy - 24
Code Review Purpose Quiz
Test your understanding of why code reviews matter.
Multiple Choice Easy - 25
Git Remote Quiz
Test your knowledge of git remote commands.
Multiple Choice Medium - 26
Fetch vs Pull Quiz
Distinguish between git fetch and git pull.
Multiple Choice Medium - 27
Git Rebase Quiz
Test your understanding of what git rebase does.
Multiple Choice Medium - 28
Cherry-Pick Quiz
Test your knowledge of what git cherry-pick does.
Multiple Choice Medium - 29
Git Tags Quiz
Test your understanding of what tags are used for in Git.
Multiple Choice Easy - 30
Git Hooks Quiz
Test your knowledge of what Git hooks are.
Multiple Choice Medium - 31
GitHub Actions Quiz
Test your understanding of what GitHub Actions does.
Multiple Choice Medium - 32
Commit Message Best Practice Quiz
Test your knowledge of good commit message practices.
Multiple Choice Easy - 33
Branch Naming Quiz
Test your knowledge of good branch naming conventions.
Multiple Choice Easy - 34
Reset --hard Quiz
Test your understanding of git reset --hard.
Multiple Choice Medium - 35
Force Push Quiz
Test your understanding of git push --force.
Multiple Choice Medium - 36
Fast-Forward Merge Quiz
Test your understanding of fast-forward merges.
Multiple Choice Medium - 37
Commit Frequency Quiz
Test your knowledge of good commit practices.
Multiple Choice Easy - 38
Predict Init Output
Predict what git init prints when run in a new empty directory.
Predict Output Beginner - 39
Predict Status After Init
Predict the output of git status in a freshly initialized repo.
Predict Output Beginner - 40
Predict Status After Add
Predict git status output after staging a new file.
Predict Output Easy - 41
Predict Log After First Commit
Predict what git log shows after the first commit.
Predict Output Easy - 42
Predict Branch List
Predict the output of git branch after creating a branch.
Predict Output Easy - 43
Predict Checkout Output
Predict what happens when you checkout a new branch with -b.
Predict Output Easy - 44
Predict Stash List
Predict what git stash list shows after stashing changes.
Predict Output Medium - 45
Predict Diff Output
Predict what git diff shows for a modified file.
Predict Output Easy - 46
Predict Merge Result
Predict the outcome of a fast-forward merge.
Predict Output Medium - 47
Predict Revert Result
Predict what happens when you revert a commit.
Predict Output Medium - 48
Predict Reset --soft Result
Predict the effect of git reset --soft HEAD~1.
Predict Output Medium - 49
Predict Ignored File Status
Predict git status output when a file matches .gitignore.
Predict Output Easy - 50
Predict Remote Add Result
Predict the output of git remote -v after adding a remote.
Predict Output Medium - 51
Predict Fetch Behavior
Predict what changes after running git fetch.
Predict Output Medium - 52
Predict Tag List
Predict the output of git tag after creating tags.
Predict Output Easy - 53
Predict Cherry-Pick Result
Predict the result of cherry-picking a commit.
Predict Output Medium - 54
Predict Rebase Conflict
Predict what happens when a rebase encounters a conflict.
Predict Output Medium - 55
Predict Log --oneline Count
Predict how many lines git log --oneline shows.
Predict Output Easy - 56
Predict Stash Pop
Predict what happens when you pop a stash.
Predict Output Medium - 57
Predict Branch Delete
Predict the result of deleting a fully merged branch.
Predict Output Medium - 58
Initialize Repository Fill
Fill in the blank to initialize a new Git repository.
Fill in the Blank Beginner - 59
Clone Repository Fill
Fill in the blank to clone a remote repository.
Fill in the Blank Beginner - 60
Commit With Message Fill
Fill in the blank to commit with a message.
Fill in the Blank Beginner - 61
Create Branch Fill
Fill in the blank to create and switch to a new branch.
Fill in the Blank Easy - 62
Push With Upstream Fill
Fill in the blank to set up tracking on first push.
Fill in the Blank Medium - 63
Oneline Log Fill
Fill in the blank to show compact one-line-per-commit log.
Fill in the Blank Easy - 64
Stash Pop Fill
Fill in the blank to restore stashed changes.
Fill in the Blank Medium - 65
Staged Diff Fill
Fill in the blank to see staged changes in diff.
Fill in the Blank Medium - 66
Add Remote Fill
Fill in the blank to add a new remote repository.
Fill in the Blank Medium - 67
Annotated Tag Fill
Fill in the blank to create an annotated tag.
Fill in the Blank Medium - 68
Revert Commit Fill
Fill in the blank to revert the last commit.
Fill in the Blank Medium - 69
Hard Reset Fill
Fill in the blank to discard all changes and match HEAD.
Fill in the Blank Medium - 70
Ignore Pattern Fill
Fill in the blank to ignore all .env files.
Fill in the Blank Easy - 71
Fetch All Remotes Fill
Fill in the blank to fetch from all remotes.
Fill in the Blank Medium - 72
Abort Rebase Fill
Fill in the blank to cancel an in-progress rebase.
Fill in the Blank Medium - 73
Cherry-Pick Fill
Fill in the blank to apply a specific commit.
Fill in the Blank Medium - 74
List All Branches Fill
Fill in the blank to list both local and remote branches.
Fill in the Blank Easy - 75
Force With Lease Fill
Fill in the blank to safely force push.
Fill in the Blank Medium - 76
Graph Log Fill
Fill in the blank to show a visual branch graph.
Fill in the Blank Medium - 77
No Fast-Forward Fill
Fill in the blank to force a merge commit.
Fill in the Blank Medium - 78
Spot the Add Mistake
Find the error in a git add command.
Find the Mistake Easy - 79
Spot the Clone Mistake
Find the error in a git clone command.
Find the Mistake Easy - 80
Spot the Branch Mistake
Find the error in a branch switching command.
Find the Mistake Easy - 81
Spot the Push Mistake
Find the error in a first-push command.
Find the Mistake Medium - 82
Spot the Reset Mistake
Find the danger in this reset command.
Find the Mistake Medium - 83
Spot the Gitignore Mistake
Find the error in a .gitignore pattern.
Find the Mistake Easy - 84
Spot the Merge Mistake
Find the error in a merge command sequence.
Find the Mistake Medium - 85
Spot the Rebase Mistake
Find the danger in this rebase command.
Find the Mistake Medium - 86
Spot the Commit Message Mistake
Find the issue with this commit message style.
Find the Mistake Easy - 87
Spot the Stash Mistake
Find the error in a stash workflow.
Find the Mistake Medium - 88
Spot the Remote Mistake
Find the error in a remote push command.
Find the Mistake Medium - 89
Spot the Tag Push Mistake
Find the error in pushing a tag to remote.
Find the Mistake Medium - 90
Spot the Workflow Mistake
Find the bad practice in this workflow.
Find the Mistake Medium - 91
Centralized vs Distributed Concept
Check your understanding of distributed version control.
Concept Check Medium - 92
Staging Area Concept
Check your understanding of the three-area Git model.
Concept Check Medium - 93
Commit Immutability Concept
Check your understanding of commit immutability.
Concept Check Medium - 94
Branch Pointer Concept
Check your understanding of how branches work internally.
Concept Check Medium - 95
Three-Way Merge Concept
Check your understanding of three-way merges.
Concept Check Medium - 96
Reset vs Revert Concept
Check your understanding of reset vs revert.
Concept Check Medium - 97
Rebase History Concept
Check your understanding of how rebase affects history.
Concept Check Medium - 98
Fork vs Clone Concept
Check your understanding of fork vs clone.
Concept Check Medium - 99
Feature Branch Concept
Check your understanding of the feature branch workflow.
Concept Check Easy - 100
Atomic Commits Concept
Check your understanding of atomic commits.
Concept Check Medium - 101
Git Purpose
What is Git primarily used for?
Multiple Choice Beginner - 102
Git Init Purpose
What does git init do?
Multiple Choice Beginner - 103
Git Add Stage
What does git add do?
Multiple Choice Beginner - 104
Git Commit Purpose
What does git commit do?
Multiple Choice Beginner - 105
Git Status Info
What does git status show?
Multiple Choice Beginner - 106
Git Branch Purpose
What does git branch feature do?
Multiple Choice Easy - 107
Git Merge Type
What does git merge do?
Multiple Choice Easy - 108
Git Push Purpose
What does git push do?
Multiple Choice Easy - 109
Git Pull Purpose
What does git pull do?
Multiple Choice Easy - 110
Git Clone Purpose
What does git clone do?
Multiple Choice Beginner - 111
Git Log Purpose
What does git log show?
Multiple Choice Easy - 112
Git Reset Hard
What does git reset --hard do?
Multiple Choice Medium - 113
Git Stash Purpose
What does git stash do?
Multiple Choice Medium - 114
Gitignore Purpose
What does .gitignore do?
Multiple Choice Easy - 115
Merge Conflict Cause
When does a merge conflict occur?
Multiple Choice Medium - 116
Pull Request Purpose
What is a pull request?
Multiple Choice Easy - 117
HEAD Reference
What does HEAD refer to in Git?
Multiple Choice Medium - 118
Git Diff Purpose
What does git diff show?
Multiple Choice Easy - 119
Git Rebase Purpose
What does git rebase do?
Multiple Choice Medium - 120
Git Tag Purpose
What is a Git tag used for?
Multiple Choice Medium - 121
Git Remote Add
What does git remote add origin <url> do?
Multiple Choice Easy - 122
Git Checkout File
What does git checkout -- file do?
Multiple Choice Medium - 123
Git Fetch vs Pull
How does git fetch differ from git pull?
Multiple Choice Medium - 124
Git Commit Amend
What does git commit --amend do?
Multiple Choice Medium - 125
Detached HEAD
What is a detached HEAD state?
Multiple Choice Medium - 126
Git Revert Purpose
How does git revert differ from git reset?
Multiple Choice Medium - 127
Staging Area Concept
What is the Git staging area?
Multiple Choice Medium - 128
Git Blame Purpose
What does git blame show?
Multiple Choice Easy - 129
Git Cherry Pick
What does git cherry-pick do?
Multiple Choice Medium - 130
Git Best Practice
Which is a good Git commit message practice?
Multiple Choice Easy - 131
Git Status Output
Predict the output.
Predict Output Beginner - 132
Git Add All
Predict the output.
Predict Output Beginner - 133
Git Commit Output
Predict the output.
Predict Output Beginner - 134
Git Branch List
Predict the output.
Predict Output Easy - 135
Git Log Oneline
Predict the output.
Predict Output Easy - 136
Git Diff Staged
Predict the output.
Predict Output Easy - 137
Git Remote V
Predict the output.
Predict Output Easy - 138
Git Stash List
Predict the output.
Predict Output Medium - 139
Git Tag List
Predict the output.
Predict Output Easy - 140
Git Show HEAD
Predict the output.
Predict Output Medium - 141
Git Branch Current
Predict the output.
Predict Output Easy - 142
Git Config User
Predict the output.
Predict Output Easy - 143
Git Rev-parse HEAD
Predict the output.
Predict Output Medium - 144
Git Merge Fast-forward
Predict the output.
Predict Output Medium - 145
Git Ls-files
Predict the output.
Predict Output Medium - 146
Git Count Commits
Predict the output.
Predict Output Medium - 147
Git Show Stat
Predict the output.
Predict Output Medium - 148
Git Symbolic Ref
Predict the output.
Predict Output Medium - 149
Git Describe
Predict the output.
Predict Output Medium - 150
Git Shortlog
Predict the output.
Predict Output Medium
Build real projects
Apply what you learned by building guided projects with starter code and solutions.