GitHub MCQs with answers Page - 10

Here, you will find a collection of MCQ questions on GitHub. 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

S

Satya • 3.38K Points
Extraordinary

Q. What does the 'git init' command do?

  • (A) Clones a remote repository
  • (B) Initializes a new Git repository in your current directory
  • (C) Pushes files to a remote repo
  • (D) Switches to the main branch

S

Satya • 3.38K Points
Extraordinary

Q. Which command deletes a local Git branch?

  • (A) git branch -r <branch>
  • (B) git delete <branch>
  • (C) git branch -d <branch>
  • (D) git remove <branch>

S

Satya • 3.38K Points
Extraordinary

Q. How can you revert a file to its last committed state?

  • (A) git pull file
  • (B) git reset file
  • (C) git restore file
  • (D) git revert file

S

Satya • 3.38K Points
Extraordinary

Q. What is a 'remote' in Git?

  • (A) A separate Git project in another folder
  • (B) A reference to another Git repository, typically hosted online
  • (C) A Git plugin
  • (D) An outdated branch

S

Satya • 3.38K Points
Extraordinary

Q. What does 'git pull origin main' do?

  • (A) Pushes changes to the origin main branch
  • (B) Clones the origin repository
  • (C) Fetches and merges the main branch from origin
  • (D) Deletes the origin repository

S

Satya • 3.38K Points
Extraordinary

Q. Which GitHub feature lets you track project progress using cards and boards?

  • (A) GitHub Projects
  • (B) GitHub Pages
  • (C) GitHub CLI
  • (D) GitHub Wiki

S

Satya • 3.38K Points
Extraordinary

Q. What does a red 'X' next to a commit in GitHub usually mean?

  • (A) The commit is outdated
  • (B) The commit is private
  • (C) A test or workflow failed
  • (D) The commit is not merged

S

Satya • 3.38K Points
Extraordinary

Q. Which command permanently removes a file from both Git history and the working directory?

  • (A) git remove
  • (B) git clean -df
  • (C) git rm filename
  • (D) git reset filename

S

Satya • 3.38K Points
Extraordinary

Q. What does 'git fetch' do?

  • (A) Fetches commits and merges them automatically
  • (B) Fetches updates from the remote but doesn't merge
  • (C) Pushes changes to the remote repository
  • (D) Deletes local changes

S

Satya • 3.38K Points
Extraordinary

Q. Which of the following helps in reducing merge conflicts?

  • (A) Always work on the same branch
  • (B) Avoid pulling updates
  • (C) Regularly pull changes and push small commits
  • (D) Never use branches

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