Git: Version Control Fundamentals

20 QuestionsBeginnerPublished:

Git: Version Control Fundamentals

Up to 20 questions, shuffled on every run

Quiz Configuration
Enterto start

Welcome to the Git Basics Quiz! This quiz covers fundamental Git concepts, version control workflows, and collaborative development best practices. Each question is multiple-choice, and you’ll find hints to help you along the way. Good luck!

Answer key and explanations20 questions

The quiz above draws 20 questions at random from these 30, so a second attempt will not be the same run. Everything in the pool is listed here.

  1. What is the command to initialize a new Git repository in an existing directory?

    Answer`git init`

  2. What is the "Staging Area" (Index) in Git?

    AnswerA buffer for pending commits

  3. How do you move changes from the Working Directory to the Staging Area?

    Answer`git add <file>`

  4. What is the purpose of "git commit"?

    AnswerTo snapshot staged changes

  5. What does "git status" show?

    AnswerThe state of tracked files

  6. How do you create a new branch and switch to it immediately?

    Answer`git checkout -b <name>`

  7. What is "git clone" used for?

    AnswerTo copy a remote repository

  8. What is a "Merge Conflict"?

    AnswerA failure in automatic merging

  9. What does "git pull" do?

    AnswerFetches and merges data

  10. What is "The SHA" (Hash) in Git?

    AnswerA commit unique identifier

  11. What is the purpose of a ".gitignore" file?

    AnswerTo exclude untracked files

  12. What does "git log" do?

    AnswerLists the commit history

  13. What is "git merge"?

    AnswerIntegrating separate histories

  14. What is the "HEAD" in Git?

    AnswerA pointer to the active branch

  15. What does "git push" do?

    AnswerSends local commits to remote

  16. What is "git diff"?

    AnswerComparing tree and index

  17. What is a "Remote" in Git?

    AnswerA shared project repository

  18. What is the "Main" (or "Master") branch?

    AnswerThe stable production branch

  19. What is "git stash"?

    AnswerStoring uncommitted work

  20. What is a "Fast-forward" merge?

    AnswerA linear branch pointer update

  21. What does "git fetch" do?

    AnswerDownloads remote metadata

  22. How do you undo a commit by creating a NEW commit with opposite changes?

    Answer`git revert <commit>`

  23. What is "git rebase"?

    AnswerReapplying commits on a base

  24. What is a "Fork"?

    AnswerA server-side repository copy

  25. What is a "Pull Request" (or Merge Request)?

    AnswerA proposal for code integration

  26. What is the "Working Directory"?

    AnswerThe current checked-out files

  27. What does "git remote -v" show?

    Answer`The fetch and push URLs`

  28. What happens if you run "git checkout <filename>"?

    Answer`The file reverts to HEAD state`

  29. What is "git rm"?

    AnswerRemoving files from the index

  30. What is a "Cherry-pick"?

    AnswerApplying a specific commit

Was this useful?

You might also enjoy

Check out some of our other posts on similar topics

Linux: System Administration Fundamentals

Linux: System Administration Fundamentals

Welcome to the Linux Basics Quiz! This quiz covers fundamental Linux concepts, commands, and system administration best practices. Each question is multiple-choice, and you'll find hints to help you a

PowerShell: Windows Scripting Fundamentals

PowerShell: Windows Scripting Fundamentals

Welcome to the PowerShell Basics Quiz! This quiz covers fundamental PowerShell concepts, cmdlets, and scripting best practices. Each question is multiple-choice, and you'll find hints to help you alon

Bash: Shell Scripting Fundamentals

Bash: Shell Scripting Fundamentals

Welcome to the Bash Basics Quiz! This quiz covers fundamental Bash scripting concepts, syntax, and best practices. Each question is multiple-choice, and you'll find hints to help you along the way. Go

CI/CD: Pipeline Automation Essentials

CI/CD: Pipeline Automation Essentials

Welcome to the CI/CD Basics Quiz! This quiz covers fundamental continuous integration and continuous delivery concepts, pipeline automation, and modern DevOps best practices. Each question is multiple

GitLab CI/CD: Pipeline Automation Fundamentals

GitLab CI/CD: Pipeline Automation Fundamentals

Welcome to the GitLab CI/CD Basics Quiz! This quiz covers the fundamentals of GitLab CI/CD, including pipelines, jobs, stages, triggers, and best practices. Test your knowledge and see how well you un

HashiCorp Vault: Secrets Management Fundamentals

HashiCorp Vault: Secrets Management Fundamentals

Welcome to the HashiCorp Vault Basics Quiz! In modern DevOps, security cannot be an afterthought. Vault provides the "Source of Truth" for secrets, certificates, and encryption. This quiz will test yo

6 related posts