Git MCQs with answers Page - 2

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 • 833K Points
Coach

Q. Which command is used to fetch and merge changes from a remote repository?

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

A

Admin • 833K Points
Coach

Q. What does git fetch do?

  • (A) Deletes remote data
  • (B) Fetches changes without merging
  • (C) Merges changes automatically
  • (D) Commits changes

A

Admin • 833K Points
Coach

Q. Which command creates a new branch?

  • (A) git new-branch
  • (B) git branch
  • (C) git checkout
  • (D) git fork

A

Admin • 833K Points
Coach

Q. Which command is used to switch branches?

  • (A) git move
  • (B) git change
  • (C) git checkout
  • (D) git shift

A

Admin • 833K Points
Coach

Q. Which command shows differences between files?

  • (A) git diff
  • (B) git status
  • (C) git log
  • (D) git compare

A

Admin • 833K Points
Coach

Q. What is a Git branch?

  • (A) A copy of repository
  • (B) A pointer to a commit
  • (C) A remote server
  • (D) A folder

A

Admin • 833K Points
Coach

Q. Which command deletes a branch?

  • (A) git delete
  • (B) git remove
  • (C) git branch -d
  • (D) git drop

A

Admin • 833K Points
Coach

Q. What is HEAD in Git?

  • (A) First commit
  • (B) Last commit
  • (C) Current branch reference
  • (D) Remote repository

A

Admin • 833K Points
Coach

Q. Which command is used to undo the last commit but keep changes?

  • (A) git reset --soft HEAD~1
  • (B) git revert HEAD
  • (C) git undo
  • (D) git remove

A

Admin • 833K Points
Coach

Q. Which file is used to ignore files in Git?

  • (A) .gitignore
  • (B) .gitconfig
  • (C) .ignore
  • (D) .gitexclude

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