Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

How to delete unpublished Git commits and get rid of them permanently?

Answer»

How to delete unpublished GIT commits and get RID of them permanently?
Choose the correct option from below list
(1)git REVERT
(2)git RESET --soft
(3)git reset --hard

Answer:-(3)git reset --hard

2.

When you run git fetch from my local repo, will it update your local code and target branch?

Answer»

When you run git FETCH from my local repo, will it UPDATE your local code and target branch?
Choose the CORRECT OPTION from below list
(1)Yes, the command will download new commits from remote and merge to the target

branch
(2)No, the command will only download the new commits and keep them in a separate

branch in local repo

Answer:-(2)No, the command will only download the new commits and keep them in a separate branch in local repo

3.

Which of the following creates new commit when you pull new changes from master to the feature branch?

Answer»

Which of the following creates new COMMIT when you pull new changes from master to the feature branch?
CHOOSE the correct option from below LIST
(1)git pull ORIGIN master
(2)git merge master
(3)git rebase master

Answer:-(2)git merge master

4.

How can you temporarily switch to a different commit?

Answer»

How can you temporarily switch to a DIFFERENT commit?
Choose the correct option from below list
(1)git RESET commitSHA
(2)all the above options
(3)git commit commitSHA
(4)git checkout commitSHA

Answer:-(4)git checkout commitSHA

5.

What is the command to reset your index as well as the working directory to the state of your last commit?

Answer»

What is the command to reset your index as well as the WORKING directory to the STATE of your LAST COMMIT?
Choose the correct OPTION from below list
(1)git checkout
(2)git clean
(3)git revert
(4)git reset

Answer:-(4)git reset

6.

What is the Git command to view all the changes since the last commit ?

Answer»

What is the Git command to view all the changes since the LAST commit ?
CHOOSE the correct option from below list
(1)git commit
(2)git changes
(3)git status
(4)git clean

Answer:-(3)git status

7.

When you run git fetch from your local repo, it will update your local changes in working area?

Answer»

When you run GIT fetch from your local repo, it will UPDATE your local changes in working AREA?
CHOOSE the correct OPTION from below list
(1)True - It fetches the latest changes and merges with the local changes
(2)False - It updates local repo only and does not affect the working area

Answer:-(2)False - It updates local repo only and does not affect the working area

8.

Which type of remote URL does not require your user-name and password while for cloning or pushing?

Answer»

Which type of remote URL does not REQUIRE your user-name and password while for CLONING or pushing?
Choose the CORRECT option from below list
(1)SSH url
(2)HTTPS Url

Answer:-(1)SSH url

9.

What does the command git checkout -b branchname do?

Answer»

What does the command git CHECKOUT -b branchname do?
CHOOSE the correct option from below LIST
(1)Deletes the new BRANCH
(2)Commits the new branch
(3)Creates a new branch and switches to this new branch
(4)Switches from the current branch to the new branch

Answer:-(3)Creates a new branch and switches to this new branch

10.

What does the command git checkout branchname do?

Answer»

What does the command git checkout branchname do?
Choose the correct option from below list
(1)Commits the NEW BRANCH
(2)Deletes the new branch
(3)Adds the new branch
(4)Switches from MAIN branch to the new branch

Answer:-(4)Switches from main branch to the new branch

11.

What is the Git command to view all the remote branches?

Answer»

What is the Git command to view all the remote branches?
CHOOSE the correct OPTION from below list
(1)git view remote branch
(2)None of the options
(3)git -V branch
(4)git branch -R

Answer:-(4)git branch -r

12.

What is the command to delete a branch in your remote repository?

Answer»

What is the command to delete a branch in your remote repository?
Choose the CORRECT option from below list
(1)git branch -d branchname
(2)NONE of the OPTIONS
(3)git push origin -d branchname
(4)git delete branchname

Answer:-(3)git push origin -d branchname

13.

What is a good practice to follow when you want to backup a local branch?

Answer»

What is a good practice to FOLLOW when you want to backup a local branch?
CHOOSE the CORRECT option from below list
(1)PUSH to remote repo
(2)Create ANOTHER copy
(3)Move to another PC
(4)None of the options

Answer:-(1)Push to remote repo

14.

What is the Git command to view the last 3 commits in one line ?

Answer»

What is the Git command to VIEW the last 3 commits in one line ?
CHOOSE the correct OPTION from below list
(1)git last 3 commits
(2)git log - ONELINE -3
(3)git show log -3
(4)git log

Answer:-(2)git log - oneline -3

15.

Which command shows the difference between the working directory and the index or staging area?

Answer»

Which command shows the difference between the working directory and the index or staging area?
Choose the correct OPTION from below LIST
(1)GIT status
(2)git diff

Answer:-(1)git status

16.

What is the Git command to blow away all the changes in a file in the working area, since the previous commit?

Answer»

What is the Git COMMAND to blow AWAY all the changes in a file in the working area, since the previous commit?
Choose the correct OPTION from below list
(1)git log filename
(2)git STATUS filename
(3)git rm filename
(4)git checkout filename

Answer:-(4)git checkout filename

17.

How can you fix a broken commit?

Answer»

How can you fix a broken COMMIT?
Choose the correct option from below LIST
(1)GIT reset
(2)git commit --AMEND
(3)git fix
(4)git rebase

Answer:-(2)git commit --amend

18.

What is the Git command to view all the commits since 1st January 2017 ?

Answer»

What is the Git command to view all the commits SINCE 1st January 2017 ?
CHOOSE the correct option from below LIST
(1)None of the OPTIONS
(2)git log - since= 2017-01-01
(3)show git log since Jan 1 2017
(4)git log

Answer:-(2)git log - since= 2017-01-01

19.

What does the command Git reset soft HEAD^ perform?

Answer»

What does the COMMAND Git reset - soft HEAD^ PERFORM?
Choose the correct option from below list
(1)MOVES commit to one before current head
(2)None of the options
(3)Moves commit to the first head
(4)Moves commit to one after current head

Answer:-(1)Moves commit to one before current head

20.

What is the Git command to view all the commits since 1st January 2017?

Answer»

What is the GIT command to view all the COMMITS since 1st JANUARY 2017 ?
Choose the correct option from below LIST
(1)None of the OPTIONS
(2)show git log since Jan 1 2017
(3)git log - since= 2017-01-01
(4)git log

Answer:-(3)git log - since= 2017-01-01

21.

___________________ removes untracked files from your working directory.

Answer»

___________________ REMOVES untracked files from your working directory.
Chose the CORRECT OPTION from below list
(1)git commit
(2)git clean -f (Path)
(3)git clean
(4)git reset

Answer:-(3)git clean

22.

How to display only the names of the changed files?

Answer»

How to DISPLAY only the names of the changed files?
Choose the correct option from below list
(1)git STATUS
(2)git log
(3)git DIFF --name-only
(4)None of the options

Answer:-(3)git diff --name-only

23.

Which command can you use to update remote refs with local refs?

Answer»

Which COMMAND can you USE to update REMOTE refs with local refs?
Choose the correct option from below list
(1)git fetch
(2)git pull
(3)git PUSH
(4)git update

Answer:-(3)git push

24.

If you want to view the changes since last commit in a specific file, which command should you use?

Answer»

If you want to view the changes since last COMMIT in a specific file, which command should you USE?
CHOOSE the correct option from below LIST
(1)git diff filename
(2)git status
(3)git log
(4)git view changes file name

Answer:-(1)git diff filename

25.

Which command shows the changes between commits?

Answer»

Which command shows the CHANGES between commits?
Choose the correct option from below list
(1)GIT DIFF
(2)git status

Answer:-(1)git diff

26.

What is the command to view all the commits made by a specific person (Jim)?

Answer»

What is the command to view all the COMMITS made by a specific person (JIM)?
Choose the CORRECT option from below list
(1)GIT log Jim
(2)git log - author= Jim
(3)git log who= Jim
(4)git log

Answer:-(2)git log - author= Jim

27.

Which command would you use to view the history of commits?

Answer»

Which command WOULD you use to view the history of COMMITS?
Choose the correct option from below list
(1)GIT view history
(2)git log
(3)git SHOW history
(4)git show commits

Answer:-(2)git log

28.

What is the Git command to skip staging and commit the changes directly?

Answer»

What is the Git COMMAND to skip staging and commit the changes DIRECTLY?
Choose the correct option from below list
(1)git skip stage
(2)git ADD changes
(3)git commit -a -m MESSAGE
(4)git commit

Answer:-(3)git commit -a -m message

29.

Git is a _________________.

Answer»

Git is a _________________.
Choose the CORRECT option from below LIST
(1)DISTRIBUTED Version Control System
(2)None of the OPTIONS
(3)Centralized Version Control System
(4)Centrally Distributed System

Answer:-(1)Distributed Version Control System

30.

Which of the following best describes Git?

Answer»

Which of the FOLLOWING best describes GIT?
Choose the correct OPTION from below list
(1)None of the options
(2)Version Control System
(3)Role Control System
(4)Access Control System

Answer:-(2)Version Control System

31.

How would you display the list of files changed in a particular commit SHA ?

Answer»

How WOULD you display the list of FILES changed in a PARTICULAR commit SHA ?
Choose the correct option from below list
(1)GIT log SHA1
(2)git diff
(3)git status SHA1
(4)git show --name-only SHA1

Answer:-(4)git show --name-only SHA1

32.

What is the Git command to view all the changes since the last commit?

Answer»

What is the GIT COMMAND to view all the changes since the last commit?
Choose the correct option from below list
(1)git commit
(2)git clean
(3)git status
(4)git changes

Answer:-(3)git status