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

Top 10 GIT Interview Questions For Sdet

TOP 10 GIT INTERVIEW QUESTION FOR SDET

Uploaded by

alliancedevlabs
Copyright
© © All Rights Reserved
Available Formats
Download as ODP, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Top 10 GIT Interview Questions For Sdet

TOP 10 GIT INTERVIEW QUESTION FOR SDET

Uploaded by

alliancedevlabs
Copyright
© © All Rights Reserved
Available Formats
Download as ODP, PDF, TXT or read online on Scribd
You are on page 1/ 12

Top 10 GIT Interview Questions for

SDET

By DevLabs Alliance

Visit us at: www.devlabsalliance.com


Email: [email protected]
Contact: +91 9717514555
GIT Interview Questions for SDET

1. What does ‘hooks’ consists of in GIT?

GIT hooks are Shell scripts that are executed before or after the corresponding GIT
commands, such as : commit, push and receive.

Git hooks are a built-in feature and there is no need to download them.

For eg.: GIT will try to execute a post commit script after a run of commit.
GIT Interview Questions for SDET

2. How can you fix a broken commit in GIT?

git command --amend command is used to fix a broken commit in GIT.

This command will fire the commit patch in $Editor. We just need to edit the message right
on the top line of the file, save and then quit.
GIT Interview Questions for SDET

3. What is conflict in GIT?

A conflict in GIT arises when the commit that needs to be merged has some change in one
file, and also the current commit has change in the same place in that file.

In this case, GIT is not able to predict that which change should take precedence.
GIT Interview Questions for SDET

4. What is ‘head’ in GIT and how many heads can be created in a


repository?

A ‘head’ in a GIT is simply a reference to a commit object.

There is a default header referred as “Master” in every repository.

A repository can contain any number of heads.


GIT Interview Questions for SDET

5. What is another option for merging in GIT and what is the syntax for
the same?

‘Rebasing’ is an alternative of merging in GIT.

Syntax:
git rebase [new-commit]
GIT Interview Questions for SDET

6. What is ‘git add’ is used for in GIT?

‘git add’ is used to add file changes in working directory to staging area.

It tells GIT that certain updates to a particular file needs to be included in the next commit.

git add <file> : Stage all changes in the file for next commit.

git add <directory> : Stage all changes in directory for the next commit.
GIT Interview Questions for SDET

7. What is the use of ‘git log’ in GIT?

‘git log’ is used to find specific commits in project history.

It can be searched by date, by author, by message, by file, etc.

For eg.:

git log --after=“yesterday”

git log --author=”DLA”


GIT Interview Questions for SDET

8. What is the use of ‘git reset’ in GIT?

‘git reset’ is used undo all the changes in the local directory as well as in the staging area
and resets it to the state of last commit.

Synatx:
git reset
GIT Interview Questions for SDET

9. What is GIT version control?

GIT version control is used to track the history of a collection of files and it also includes
the functionality to revert the collection of files to another version.

Each version captures a screenshot of the file system at a certain point of time. All files and
their complete history are stored in a repository.
GIT Interview Questions for SDET

10. Mention some of the best graphical GIT client for LINUX.

Some of the best GIT client for LINUX are:

• Smart Git
• Git Cola
• GIT GUI
• qGit
• Git-g
• Giggle
Visit us at: www.devlabsalliance.com
Email: [email protected]
Contact: +91 9717514555

You might also like