How to find out the beginning of fixing a branch?

From version control with Git from Loeliger, 2ed,

Since the original commit from which the branch was launched is not explicitly identified, that the commit (or its equivalent) can be found algorithmically using the name of the original branch, from which the new fork branch:

git merge-base original-branch new-branch
  • Is it correct that, in the repository graph view, a branch is a commit path?

  • if you look at the repository graph with a branch name pointing to the end of each branch, but without specifying the initial commit of each branch, how do you know the initial commit of each branch?

+4
source share
2 answers

, , , ?

git log --graph --decorate

// To get the same display as in the image below add the --onelilne as well
git log --graph --decorate --oneline

enter image description here

+5

, - ?

. , "" "" . ( - ""? , , "", "" node, ""...)

, , , ?

, . :

            B - C
          /       \
... o - A           F - G    <-- br
          \       /
            D - E

" " br? B A, - , A ( ... - o)? , , D / E?

, , :

            B - C
          /       \
... o - A           F - G    <-- br
          \       /
            D - E            <-- newfeature

; F , , merge branch newfeature into br. , , D " " newfeature, , commit F, , git merge newfeature, br. br, , A.

Reflogs .

, , . newfeature ( reflog); reflog 90 ( 30 , , , ).

, -:

            B - C
          /       \
... o - A           F - G    <-- br
          \       /
            D - E            <-- origin/br

origin/br, , , br, F , - git merge (, git pull), / - . br, (, ).


" X", git ( " ?" ).

+4

Source: https://habr.com/ru/post/1622235/


All Articles