B
B
beduin012015-03-22 18:19:50
git
beduin01, 2015-03-22 18:19:50

GIT: What are branch pointers for?

I still could not understand why pointers to branches are needed? Okay Head points to the commit where we are currently working. What prevents it from being used everywhere? Why else do we need some pointers to branches (and even in such a wild amount).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Kiselev, 2015-03-26
@alexeykiselev

The pointer allows you to refer to a specific commit by a meaningful name.
There is not much difference between HEAD and named commits to branches or tags.
It’s just that if they don’t exist, it will be difficult for you to find the desired branch or tag yourself.
How can you use one HEAD to point to the current commit and branch commits? He alone will have to show everything? And be a dictionary so that you can store several different pointers under different names in it alone? Now think about the distributed nature of Git and think about how you would keep such a HEAD in sync across repositories. How would you understand which branches or tags are local and which ones need to be merged into a remote repository.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question