<> In Git each commit has a unique hash. These hashes are used to identify the corresponding commits in various scenarios, for example, while trying to checkout a particular state of the code using the git checkout {hash} command.
<> Along with this, Git maintains a number of aliases to certain commits, known as refs. Also, every tag that is created in the repository effectively becomes a ref and that is exactly why you can use tags instead of committing hashes in various git commands. Git also maintains a number of special aliases that are changed based on the state of the repository, such as HEAD, FETCH_HEAD, MERGE_HEAD, etc.
<> In Git, commits are allowed to be referred to as relative to one another. In the case of merge commits, where the commit has two parents, ^ can be used to select one of the two parents, for example, HEAD^2 can be used to follow the second parent.
<> And finally, refspecs are used to map local and remote branches together. However, these can also be used to refer to commits that reside on remote branches allowing one to control and manipulate them from a local git environment.
Posted Date:- 2021-10-18 07:17:44
How to remove untracked files in Git ?
How to squash the last N commits into a single commit?
What is Git bisect? How does it help to determine the source of a (regression) bug?
Explain the role of the git annotate command.
Explain the role of the git-add command.
How will you remove a file from Git without actually removing it from your local filesystem?
What is the syntax for rebasing?
What’s the difference between rebase and merge? When should you rebase and when should you merge?
What is ‘bare repository’ in GIT?
What is ‘bare repository’ in GIT?
What does a Commit object contain?
What is the difference between Git stash apply and Git stash pop?
Explain the functions of the git reset –mixed and git merge –abort commands.
Why is it advisable to create an additional commit rather than amending an existing commit?
How can you fix a broken commit?
Mention some of the best graphical GIT client for LINUX?
What are the functionalities of git reset --mixed and git merge --abort?
Can you recover a deleted branch in Git?
Why are the Git Stash Drop and Git Stash Clear commands used?
What is the difference between git checkout [branch name] and git checkout -b [branch name]?
How will you find out what all files have been changed in a particular Git commit?
State the difference between HEAD, working tree, and index.
Will you create an additional commit or amend an existing commit?
How to resolve and solve merge conflicts?
What are the constituents of the commit object contain?
How to identify if a certain branch has been merged into master?
What is the difference between resetting and reverting?
How to deal with huge binary files in Git?
What are the different ways you can refer to a commit?
In Git, how would you return a commit that has just been pushed and made open?
What does ‘hooks’ comprise of in Git?
Why is it desirable to create an additional commit rather than amending an existing commit?
How will you know in Git if a branch has already been merged into master?
What is the use of git instaweb?
What is a conflict in Git and how to resolve it?
Name some Basic Operations in Git.
Describe the branching strategies you have used.
How to revert a bad commit which is already pushed?
What does a commit object contain?
How do you find a list of files that have changed in a particular commit?