How does merge without branch work?

In this simple git tutorial, merging is always done on a branch:

git merge <branch>

In my new work environment, however, I came across a practice in which developers pull from the master (i.e. not to their own branch), but when they push their changes (which they perform on their own host), they push it towards another "master" (actually a "personal branch"). The CI system then attempts to merge this “personal branch” with the master (remote repository).

I know this works because the team has been working for so many years. But how does it work in terms git? Does it fit git concepts?

Or does it violate some basic principle?

+4
source share
1 answer

I know this works because the team has been working for so many years. But how does it work in terms of git itself ...

The CI system then attempts to merge this “personal branch” with the master (remote repository).

If you do not specify a git branch, use the current branch as the "second" branch name for merging, in git you can write as many branches as you want for merging.

git merge A B C  ... N

git will select appropriate merge strategies based on the number of branches.


, pull (.. ), push ( ) "" ( " " ).

CI " " ( ).

. git . "" , , .

, IT/devops, .

+2

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


All Articles