Git Basics Quiz
← Back to Quiz Home
Welcome! 🚀
Test your fundamental Git knowledge with this quick quiz. Perfect for beginners starting their version control journey.
Instructions:
- Select the best answer for each question.
- Your score will be shown at the end.
- Aim for 100% to prove you are ready for the next level!
Which command initializes a new Git repository?
git init creates a new Git repository, typically by creating a .git directory.
Which command adds files to the staging area?
git add moves changes from the working directory to the staging area (index).
Which command creates a new branch?
git branch [name] creates a new branch. To create and switch, you would use git checkout -b.
Which command downloads a repository from a remote source?
git clone downloads the entire repository history and checks out the default branch.
Which command shows the status of changes?
git status shows tracked, untracked, modified, and staged files.
Which command records changes to the repository?
git commit captures a snapshot of the project's currently staged changes.
How do you configure your global username in Git?
git config is used to set configuration options.
Which command sends your local commits to a remote repository?
git push updates the remote repository with your local commits.
Which file is used to specify files that Git should ignore?
.gitignore tells Git which files or directories to ignore (not track).
Which command lists all your commits?
git log displays the commit history.
How do you check the version of Git installed on your machine?
git --version prints the Git suite version.
Which command displays help information about Git commands?
git help displays the manual page for a command.
Which area holds changes before they are committed?
The Staging Area (or Index) holds your prepared snapshot for the next commit.
Which command lists all configured remote repositories?
git remote -v shows all remotes and their URLs.
Which directory contains the metadata and object database for your repository?
The .git folder contains all the information necessary for your project in version control.
What does HEAD usually refer to?
HEAD is a pointer to the specific commit you’re currently looking at (usually the tip of the current branch).
Which command removes a file from the repository?
git rm removes files from the working tree and from the index.
Which command renames a file (or moves it)?
git mv is used to move or rename a file, directory, or symlink.
Which flag adds all modified (tracked) files to the staging area during commit?
git commit -a stages files that have been modified and deleted, but involves no new files.
How do you create a tag for a specific commit?
git tag is used to tag specific points in history as being important.
Quiz Progress
0 / 0 questions answered
(0%)
0 correct
Quiz Complete!
0%
📚 Study Guides
📬 Weekly DevOps, Cloud & Gen AI quizzes & guides