Git Commands Quiz
Test your knowledge of essential Git commands and concepts. Please answer all questions to the best of your ability.
Full Name
*
First Name
Last Name
Which command initializes a new Git repository in your current directory?
*
git init
git start
git create
Other
Which command stages all modified files for the next commit?
*
git add .
git commit -a
git stage *
Other
What command is used to check the status of your working directory and staging area?
*
git status
git check
git log
Other
To clone a repository from a remote URL, use
Command to clone a repository
.
Which command is used to view the commit history?
*
git log
git history
git commits
Other
Match each Git command to its description.
*
Rows
Description
git init
Initialize repository
Stage changes
Record snapshot
Show changes
git add
Initialize repository
Stage changes
Record snapshot
Show changes
git commit
Initialize repository
Stage changes
Record snapshot
Show changes
git diff
Initialize repository
Stage changes
Record snapshot
Show changes
You want to discard all local changes in your working directory. Which command would you use?
*
git checkout -- .
git revert
git reset --hard
Other
Rate your confidence in using Git commands.
*
1
2
3
4
5
Briefly explain how to resolve a merge conflict in Git.
*
Which command would you use to create a new branch called 'feature-x'?
*
Submit Quiz
Should be Empty: