▶ 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
Exam2
Exam2
devops / Git
• 20 questions
Question 1 of 20
Which command displays the installed Git version?
A.
git --version
B.
git version
C.
git show-version
D.
git -v
Question 2 of 20
Which command stages a specific file named app.py?
A.
git add app.py
B.
git stage app.py
C.
git commit app.py
D.
git push app.py
Question 3 of 20
Which command commits staged changes with message 'fix bug'?
A.
git commit 'fix bug'
B.
git commit -m 'fix bug'
C.
git save -m 'fix bug'
D.
git add -m 'fix bug'
Question 4 of 20
Which command shows a compact one-line commit history?
A.
git log --oneline
B.
git log -1
C.
git history --short
D.
git show-log --one
Question 5 of 20
Which command creates a new branch named test?
A.
git new test
B.
git branch test
C.
git checkout test
D.
git create test
Question 6 of 20
Which command switches to branch main?
A.
git checkout main
B.
git branch main
C.
git merge main
D.
git switch -n main
Question 7 of 20
Which command downloads remote changes without merging?
A.
git pull
B.
git clone
C.
git fetch
D.
git sync
Question 8 of 20
Which command combines changes from another branch?
A.
git merge
B.
git join
C.
git combine
D.
git sync
Question 9 of 20
Which command removes the last commit but keeps changes locally?
A.
git reset --soft HEAD~1
B.
git undo HEAD~1
C.
git revert HEAD
D.
git delete HEAD
Question 10 of 20
Which command creates a new commit that reverses a previous commit?
A.
git reset
B.
git revert
C.
git undo
D.
git rollback
Question 11 of 20
Which command compares staged changes against the last commit?
A.
git diff --cached
B.
git diff
C.
git status
D.
git compare
Question 12 of 20
Which command pushes a branch and sets upstream tracking?
A.
git push origin
B.
git push -u origin main
C.
git push --track
D.
git publish main
Question 13 of 20
Which command lists saved stashes?
A.
git stash list
B.
git list stash
C.
git stash show-all
D.
git stash log
Question 14 of 20
Which command reapplies the most recent stash and removes it from stash list?
A.
git stash apply
B.
git stash pop
C.
git stash use
D.
git stash restore
Question 15 of 20
Which command lists all tags?
A.
git tags
B.
git tag
C.
git list-tag
D.
git show tags
Question 16 of 20
Which command changes the URL of remote origin?
A.
git remote set-url origin <url>
B.
git remote change origin <url>
C.
git origin set <url>
D.
git set remote origin <url>
Question 17 of 20
Which command deletes a local branch named old-feature?
A.
git remove old-feature
B.
git delete branch old-feature
C.
git branch -d old-feature
D.
git branch --remove old-feature
Question 18 of 20
Which command clones only a specific branch?
A.
git clone --branch main <url>
B.
git clone main <url>
C.
git fetch --branch main <url>
D.
git clone --only main <url>
Question 19 of 20
Which command shows all Git configuration values?
A.
git config --list
B.
git config --show
C.
git settings --all
D.
git config --all
Question 20 of 20
Which command shows who changed each line in a file?
A.
git log file.txt
B.
git blame file.txt
C.
git diff file.txt
D.
git track file.txt
← Back
Submit Answers ✓