Top Git interview questions and answers

Posted by

What is Git fork?

Forking is a git clone operation executed on a server copy of a project’s repo. A Forking Workflow is often used in conjunction with a Git hosting service like Bitbucket. A high-level example of a Forking Workflow is: You want to contribute to an open-source library hosted at bitbucket.org/userA/open-project.

What is tree-ish in Git?

“Tree-ish” is a term that refers to any identifier (as specified in the Git revisions documentation) that ultimately leads to a (sub) directory tree (Git refers to directories as “trees” and “tree objects”). In the original poster’s case, foo is a directory that he wants to specify.

What is the head in Git?

The HEAD in Git is the pointer to the current branch reference, which is in turn a pointer to the last commit you made or the last commit that was checked out into your working directory. That also means it will be the parent of the next commit you do.

What is the local repo in git?

The local repository is a Git repository that is stored on your computer. The remote repository is a Git repository that is stored on some remote computer. … This can be done even when you are disconnected from the internet and nobody else can see the changes in your local repository.

What is a git clone?

git clone is a Git command-line utility that is used to target an existing repository and create a clone or copy of the target repository. … Cloning a local or remote repository. Cloning a bare repository. Using shallow options to partially clone repositories. Git URL syntax and supported protocols.

What do hooks consist of in Git?

Git hooks are scripts that run automatically every time a particular event occurs in a Git repository. They let you customize Git’s internal behavior and trigger customizable actions at key points in the development life cycle.

What is a master in git?

In Git, “master” is a naming convention for a branch. After cloning (downloading) a project from a remote server, the resulting local repository has a single local branch: the so-called “master” branch. This means that “master” can be seen as a repository’s “default” branch.

What is git workflow?

A Git workflow is a recipe or recommendation for how to use Git to accomplish work in a consistent and productive manner. Git workflows encourage developers and DevOps teams to leverage Git effectively and consistently. Git offers a lot of flexibility in how users manage changes.

What do hooks consist of in Git?

Git hooks are scripts that run automatically every time a particular event occurs in a Git repository. They let you customize Git’s internal behavior and trigger customizable actions at key points in the development life cycle.