Git Github Basics MCQs with Answers and Explanations
Practice Git Github Basics MCQs. from DevOps subject. with solved answers and explanations. updated syllabus-based questions.
Search MCQs, Papers, Topics
Question 1: What is a "pull request" (PR) in Git-based workflows?
A pull request (PR) is a mechanism in GitHub/GitLab/Bitbucket for proposing changes from one branch to another. It enables code review, discussion, and automated testing before changes are merged into the main branch.
Question 2: What is the purpose of the `.gitignore` file?
The .gitignore file specifies patterns of files and directories that Git should ignore and not track. Common examples include compiled binaries, log files, and environment config files.
Question 3: Which command is used to check the status of a Git repository?
git status displays the state of the working directory and staging area. It shows which changes have been staged, which have not, and which files are untracked.
Question 4: Which Git command is used to download changes from a remote repository without merging?
git fetch downloads changes from a remote repository but does not automatically merge them into the current branch. git pull fetches and merges in one step.
Question 5: In Git, which command is used to create a new branch?
The command git branch <name> creates a new branch in Git. To also switch to it immediately, git checkout -b <name> or git switch -c <name> can be used.
Showing 1 to 5 of 5 results