Git MCQ Questions and Answers
Q. What is Git?
A. A version control systemB. A project management tool
C. A collaboration platform
D. A software development framework
Q. What is the purpose of branching in Git?
A. To create a new repositoryB. To merge two repositories
C. To create a new version of a project
D. To work on different features or changes in isolation
Q. What is a commit in Git?
A. A change to a fileB. A new branch
C. A snapshot of the repository at a specific point in time
D. A request to make changes to a file
Q. How do you create a new branch in Git?
A. git initB. git branch <branch_name>
C. git checkout -b <branch_name>
D. git switch -c <branch_name>
Q. How do you switch between branches in Git?
A. git switch <branch_name>B. git checkout <branch_name>
C. git branch <branch_name>
D. git change <branch_name>
Q. What is a remote repository in Git?
A. A local copy of a repositoryB. A repository hosted on a remote server
C. A repository with read-only access
D. A repository with write-only access
Q. How do you add a remote repository in Git?
A. git add remote <remote_name> <remote_url>B. git remote add <remote_name> <remote_url>
C. git add <remote_name> <remote_url>
D. git remote <remote_name> <remote_url>
Q. How do you push changes to a remote repository in Git?
A. git push origin masterB. git push remote master
C. git push origin <branch_name>
D. git push remote <branch_name>
Q. How do you pull changes from a remote repository in Git?
A. git pull origin masterB. git fetch origin master
C. git pull remote master
D. git fetch remote master