0% found this document useful (0 votes)
2 views

ModuleWiseQues unchanged

The document outlines a comprehensive guide on Git, covering its basic concepts, commands for workflow and commits, branching and merging, and collaboration with remote repositories. It includes multiple-choice questions that test knowledge on Git functionalities, such as initializing repositories, staging changes, merging branches, and resolving conflicts. This structured approach serves as an educational resource for understanding and utilizing Git effectively.

Uploaded by

sarimane07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

ModuleWiseQues unchanged

The document outlines a comprehensive guide on Git, covering its basic concepts, commands for workflow and commits, branching and merging, and collaboration with remote repositories. It includes multiple-choice questions that test knowledge on Git functionalities, such as initializing repositories, staging changes, merging branches, and resolving conflicts. This structured approach serves as an educational resource for understanding and utilizing Git effectively.

Uploaded by

sarimane07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Module 1: Git Basics & Setup

1. What is Git?
a) A cloud storage service
b) A programming language
c) A distributed version control system
d) A database tool
2. Which command initializes a Git repository?
a) git create
b) git start
c) git init
d) git begin
3. What does git status do?
a) Shows the current state of the working directory and staging
area
b) Commits changes to the repository
c) Switches branches
d) Resets the repository
4. How do you check the configured username in Git?
a) git show user
b) git name --global
c) git get user
d) git config user.name
5. Which file is used to ignore specific files from being tracked?
a) ignore_list.txt
b) .gitignore
c) skip_files.txt
d) exclusion_list.txt
6. What is the default branch created when initializing a repository
in newer versions of Git?
a) main
b) trunk
c) main
d) default
7. Which command clones a repository?
a) git duplicate
b) git clone <repository_url>
c) git copy <repository_url>
d) git fetch
8. What is the purpose of git config --global user.email?
a) Sets the global email for commits
b) Adds an email signature to commits
c) Sends commit notifications
d) Creates an email alias
9. Which of the following is NOT a version control system?
a) Git
b) Dropbox
c) Mercurial
d) Subversion
10.Which Git command lists all the configured remotes?
a) git show remotes
b) git check remotes
c) git remote -v
d) git fetch remotes
Module 2: Git Workflow & Commits
11.Which command stages all changes in the working directory?
a) git add .
b) git commit -m "message"
c) git track all
d) git push
12.What does git commit -m "Initial commit" do?
a) Sends changes to GitHub
b) Records staged changes with a message
c) Creates a new branch
d) Adds changes to staging
13.How do you view the commit history?
a) git history
b) git commits
c) git log
d) git track
14.Which command is used to modify the most recent commit
message?
a) git reset
b) git amend
c) git commit --amend
d) git modify
15.What happens when you run git reset HEAD file.txt?
a) Removes the file from the staging area but keeps changes in
the working directory
b) Deletes the file permanently
c) Restores the file to its original state
d) Resets the entire repository
16.What is the purpose of git stash?
a) Temporarily saves changes without committing them
b) Merges two branches
c) Deletes untracked files
d) Pushes changes to GitHub
17.How do you apply the most recent stash?
a) git restore stash
b) git bring stash
c) git stash pop
d) git stash apply
18.Which command shows changes made between two commits?
a) git diff
b) git compare
c) git track
d) git show
19.How do you remove untracked files from the working directory?
a) git clean -f
b) git delete --all
c) git reset --hard
d) git remove
20.Which command creates a new commit while undoing a previous
commit?
a) git revert
b) git undo
c) git redo
d) git rollback
Module 3: Branching & Merging
21.Which command creates a new branch?
a) git create branch_name
b) git branch branch_name
c) git new branch_name
d) git branch -new branch_name
22.How do you switch to another branch?
a) git move branch_name
b) git checkout branch_name
c) git go branch_name
d) git switch branch_name
23.Which command merges a branch into the current branch?
a) git combine branch_name
b) git merge branch_name
c) git sync branch_name
d) git join branch_name
24.What is a fast-forward merge?
a) A merge where the current branch pointer moves ahead
without creating a new commit
b) A forced merge
c) A special type of commit
d) A backup merge
25.Which command deletes a branch?
a) git delete branch_name
b) git remove branch_name
c) git branch -d branch_name
d) git drop branch_name
26.What is a rebase in Git?
a) Reapplies commits on top of another branch
b) Creates a backup
c) Deletes a branch
d) Restores lost commits
27.Which command aborts an in-progress merge?
a) git reset
b) git clear
c) git merge --abort
d) git cancel merge
28.How do you view all branches in a repository?
a) git branches
b) git branch -a
c) git list branches
d) git show branches
29.Which command shows which branches are already merged?
a) git merged
b) git branch --merged
c) git check branches
d) git log --merged
30.How do you rename a branch?
a) git branch -m new_name
b) git rename branch new_name
c) git modify branch new_name
d) git branch --rename new_name
Module 4: Remote Repositories & Collaboration
31.Which command adds a remote repository?
a) git remote add origin URL
b) git connect origin URL
c) git link origin URL
d) git attach origin URL
32.Which command fetches changes from a remote repository
without merging them?
a) git fetch
b) git pull
c) git merge
d) git update
33.Which command pushes local commits to a remote repository?
a) git upload
b) git push
c) git sync
d) git transfer
34.What is the purpose of a pull request (PR) in GitHub?
a) To propose changes before merging them into the main
repository
b) To directly merge code
c) To create a backup branch
d) To delete a repository
35.How do you pull the latest changes from a remote repository and
merge them into your branch?
a) git update
b) git pull
c) git fetch
d) git merge origin
36.What does forking a repository do?
a) Deletes the repository
b) Creates a copy of the repository under your account
c) Merges changes from another branch
d) Creates a backup on GitHub
37.What is a Git merge conflict?
a) A situation where two commits change the same file differently,
requiring manual resolution
b) An error in commit history
c) A failed repository clone
d) An issue with remote tracking
38.How do you resolve a merge conflict?
a) Manually edit the conflicting file and commit the resolved
version
b) Delete the repository and start over
c) Use git undo conflict
d) Restart Git
39.Which command sets up authentication for pushing to a private
repository?
a) git allow push
b) git auth setup
c) Using SSH keys or Personal Access Tokens (PATs)
d) git login
40.How do you contribute to an open-source project on GitHub?
a) Fork the repository, make changes, push to your fork, and open
a pull request
b) Download the repository and email your changes
c) Request direct write access
d) Copy and paste changes into the repository

You might also like