▶ ExamTry
Home
Medical
Neet Ug
4
Ssc-Cgl
General_Awareness
5
Mock-Test
5
Devops
Git
3
Ansible
10
Aws
5
Azure
10
Docker
5
Jenkins
5
Kubernetes
5
Terraform
10
⚑ Feedback
Home
Git
Exam3
Exam3
devops / Git
• 20 questions
Question 1 of 20
Which command initializes an empty Git repository in the current directory?
A.
git start
B.
git init
C.
git create
D.
git repo-init
Question 2 of 20
Which command shows the status of tracked and untracked files?
A.
git state
B.
git status
C.
git info
D.
git files
Question 3 of 20
Which command stages all tracked modified and deleted files?
A.
git add .
B.
git add -u
C.
git stage all
D.
git commit -a
Question 4 of 20
Which command amends the most recent commit?
A.
git commit --amend
B.
git amend
C.
git commit --fix
D.
git reset --amend
Question 5 of 20
Which command shows the commit history with branch and merge graph?
A.
git log --graph --oneline --all
B.
git history --graph
C.
git log --tree
D.
git show --graph
Question 6 of 20
Which command switches to a new branch named feature-login using modern syntax?
A.
git switch -c feature-login
B.
git checkout -n feature-login
C.
git branch feature-login -s
D.
git create feature-login
Question 7 of 20
Which command lists both local and remote branches?
A.
git branch -a
B.
git branch -r
C.
git list --all
D.
git branches -all
Question 8 of 20
Which command fetches updates from all remotes?
A.
git pull --all
B.
git fetch --all
C.
git remote fetch
D.
git sync --all
Question 9 of 20
Which strategy keeps merge history by creating a merge commit even if fast-forward is possible?
A.
git merge --no-ff branch-name
B.
git merge --ff-only branch-name
C.
git merge --force branch-name
D.
git merge --keep branch-name
Question 10 of 20
Which command reapplies commits on top of another base branch?
A.
git merge
B.
git cherry-pick
C.
git rebase
D.
git replay
Question 11 of 20
Which command compares the working directory with the staging area?
A.
git diff
B.
git diff --cached
C.
git compare
D.
git status -d
Question 12 of 20
Which command discards local changes in file app.py and restores it from the last commit?
A.
git checkout -- app.py
B.
git reset app.py
C.
git remove app.py
D.
git restore --staged app.py
Question 13 of 20
Which modern command restores a file from HEAD?
A.
git restore app.py
B.
git reset app.py
C.
git checkout app.py
D.
git recover app.py
Question 14 of 20
Which command saves uncommitted changes with a custom message?
A.
git stash push -m "work in progress"
B.
git stash -m "work in progress"
C.
git save -m "work in progress"
D.
git stash msg "work in progress"
Question 15 of 20
Which command creates an annotated tag v2.0 with a message?
A.
git tag -a v2.0 -m "release v2.0"
B.
git annotate v2.0 "release v2.0"
C.
git tag v2.0 "release v2.0"
D.
git release -a v2.0
Question 16 of 20
Which command removes a remote named origin?
A.
git remote remove origin
B.
git remote delete origin
C.
git remove remote origin
D.
git remote rm-origin
Question 17 of 20
Which command applies a specific commit from another branch onto the current branch?
A.
git apply <commit>
B.
git merge <commit>
C.
git cherry-pick <commit>
D.
git import <commit>
Question 18 of 20
Which reset mode keeps working directory changes but unstages them?
A.
--hard
B.
--soft
C.
--mixed
D.
--clean
Question 19 of 20
Which command shows changes introduced by a specific commit?
A.
git diff <commit>
B.
git show <commit>
C.
git inspect <commit>
D.
git log <commit>
Question 20 of 20
Which command removes untracked files from the working directory?
A.
git reset --clean
B.
git clean -f
C.
git remove -u
D.
git purge
← Back
Submit Answers ✓