git-gui - How to merge across branches in gitlab?
Now my colleague A has started a project, which is divided into A, which contains some instructions and common.css and other components;
Then colleague B creates a new branch B,
Colleague C switches to Part B locally and creates Part C
Then colleagues B and C develop in their respective branches
After the development is completed and pushed to the remote, the project content needs to be merged into a branch
Question 1: Can branch B be merged into branch C or branch C be merged into branch B?
Question 2: Can branches B and C be merged into branch A?
Question 3: What is the difference between merge to working tree and fast-forward merge?
Also, no rebase is desired.
Don’t you all have a public dev branch?
Pull a development branch from dev. After development is completed, everyone will merge it into dev.
Have conflicts and resolve conflicts.
First of all, native git supports the creation and merging of branches1, so all code version management tools based on git (such as gitlab/github) also support branch functions by default. (gitlab also has permission management functions )
In addition, a major problem in the subject's project is as @52lidan said, There is no branch
dev
which leads to confusion in code version management (is the A, B or C branch the most important?) , so the advice to the subject is :The project must have the following branches
master
: Code branch (protected) that can be officially released to the production environment2dev
: After development and preliminary testing, a working code branch is used to merge everyone’s work and fixed bugs (protected)Create a new branch for each task, and people follow the task instead of tasks following people. In other words, on the remote library, the task has only one branch, and everyone pulls it to the local. Everyone about The work of this task needs to be committed locally and then pushed to the task branch. (It is not recommended for more than three people to collaborate on a task, otherwise the task will be broken down into more branches)
protected
in gitlab. Only people in the project who have obtained theowner
/protected
, 该分支只有项目中获得owner
/master
权限的人才能合并别人提交的merge request
permission can merge themerge request
submitted by others. ↩I don’t quite understand the meaning of the question. Merging itself is carried out between different branches. Why can’t it be merged across branches?
Even if the merge is on a first-come, first-served basis, if the local development is completed without pushing updates to the remote end, how can there be a merge situation? At least there should be a b on the remote end. If not, then merge it into a. But this is not good
Branches must have bifurcation points. The farther away from the bifurcation point, the greater the inconsistency in theory, and the more human intervention is needed to merge. There is no branch that cannot be merged without human intervention
Question 1: Yes
Question 2: Yes
Question 3: I don’t know