Git MCQs with answers Page - 10

Here, you will find a collection of MCQ questions on Git. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 832.27K Points
Coach

Q. Which Git command can rewrite commit history?

  • (A) git merge
  • (B) git rebase
  • (C) git pull
  • (D) git fetch

A

Admin • 832.27K Points
Coach

Q. What does git reset --mixed do?

  • (A) Resets everything
  • (B) Resets HEAD and staging area
  • (C) Resets HEAD only
  • (D) Deletes working directory files

A

Admin • 832.27K Points
Coach

Q. Which command shows only commit hashes?

  • (A) git log --oneline
  • (B) git log --pretty=oneline
  • (C) git log --pretty=format:%H
  • (D) git show --hash

A

Admin • 832.27K Points
Coach

Q. Which Git object represents a directory?

  • (A) Blob
  • (B) Tree
  • (C) Commit
  • (D) Tag

A

Admin • 832.27K Points
Coach

Q. Which command is used to apply a patch file?

  • (A) git patch
  • (B) git apply
  • (C) git diff apply
  • (D) git merge patch

A

Admin • 832.27K Points
Coach

Q. What does git bundle do?

  • (A) Combines branches
  • (B) Creates a portable repository file
  • (C) Archives commits
  • (D) Compresses working tree

A

Admin • 832.27K Points
Coach

Q. Which command shows commits that modified a specific file?

  • (A) git log file
  • (B) git history file
  • (C) git show file
  • (D) git diff file

A

Admin • 832.27K Points
Coach

Q. Which command stages part of a file interactively?

  • (A) git add -p
  • (B) git stage -i
  • (C) git commit -p
  • (D) git partial add

A

Admin • 832.27K Points
Coach

Q. Which command displays commit history with file changes?

  • (A) git log --stat
  • (B) git log --files
  • (C) git log --details
  • (D) git show --log

A

Admin • 832.27K Points
Coach

Q. Which command signs tags using GPG?

  • (A) git tag -s
  • (B) git tag -a
  • (C) git tag -v
  • (D) git sign tag

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ