InterviewSolution
| 1. |
In how many ways we can refer commits in GIT? |
|
Answer» In Git, each commit is extraordinarily recognized by a novel hash number. These hashes can be utilized to DISTINGUISH the related commit much of the time, (for example, when we attempt to check out a specific condition of the CODE UTILIZING the git checkout {hash} order). Aside from this, Git dependably KEEP data on various nom de plumes to guide to a specific commit, known as refs. LIKEWISE, every single label that we make in the repo turns into a ref (and that is actually why we can utilize labels rather than submit hashes in different git directions). Git dependably keeps up various extraordinary false names that change depending on the condition of the archive, for example, HEAD, FETCH_HEAD, MERGE_HEAD, and so forth. Git dependably permits resolves to be alluded as in respect to each other. For instance, HEAD~1 alludes to the commit parent to HEAD, HEAD~2 alludes to the grandparent of HEAD, etc. In the event of consolidation commits, where the commit has two guardians, ^ can be utilized to choose one of the two guardians, for example, HEAD^2 can be utilized to pursue the second parent. Lastly, refspecs. These are constantly used to outline and remote branches together. In any case, these can be utilized to allude to commits that live on remote branches enabling one to control and control them from a neighborhood Git condition. |
|