Git: why do we need to run 'git merge' twice?

Often in a simple branch merge, when I start git merge <branch_name>, the actual merge (or fast forward) does not happen: Git reports something like this:

$ git merge <branch_name>  
Updating ccd6d17..bd32447

$ 

Then, when I run the same command git merge <branch_name>a second time, it works fine:

$ git merge <branch_name>  
Updating ccd6d17..bd32447

$ git merge <branch_name>
Updating ccd6d17..bd32447
Fast-forward
 <file1>                                    |   1 -
 <file2>                                    |   8 +-
 ....
 14 files changed, 379 insertions(+), 83 deletions(-)

$

I can not find an explanation for this behavior. Is this the expected behavior (at least in some cases)?

+4
source share

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


All Articles