github - Does the git branch renaming affect branch hierarchy? -
I am working on a multi-branch project managed by GIT.
Our workflow is currently one:
Master | - & gt; V1 / Master | - & gt; V1 / dev Note: Each developer realizes the work of "fork" for v1 / dev. Probably we have a number of branches v1 / dev and current v1 / dev branch v1 To debug / debug.
We target this new workflow:
master | - & gt; V1 / Master | - & gt; V1 / debug | - & gt; V1 / dev Note: To make everyone feel the unit work, continue to make "fork" v1 / dev.
I have the solution to add an intermediate branch v1 / debug.
After some research, I will use the rename branch command (git).
Does this command preserve the branch hierarchy?
Can I change the name v1 / dev to v1 / debug and after that the existing v1 / dev branch can create new v1 / dev branch whitout to cause problems in the current development branch results ?
Are the developers able to merge the unit branch result of v1 / debug in the named V1 / DIV?
First of all, change Rename branch You change the name of your local branch Remember that git is a distributed system For example, v2 / debug can be the name of a local branch on which tracking Remote tracking branch may be original / v1 / master (I do not understand, but because git is a distributed system, such as people station want Rename the branch from a distance . It will mess up, because it will not change the local treasures of your colleagues. The branches will continue to point out the same remote tracking branches (same name). All you need to do is create a new branch and start it in the present time. To do this directly:
git checkout -b V1 / debug v1 / master Or to create it only, but stay on your current branch:
git branch v1 / debug v1 / master Brush Anch is made locally and still it is necessary for others to be pushed to be able to see it.
Later, you only need one thing to change your merge workflow. From now on, stop v1 / dev to merge directly into v1 / master , and merge it only in v1 / debug . Merge any code in v1 / debug whenever code base is created in v1 / master . You were talking about the branch hierarchy . Indeed, the branch serial number is «unknown» for the guitar. Example of workflow with pictures -
Initial position (only v1 / master and v1 / dev ). Here, it is assumed that before v1 / dev> 1 v1 / master it is also believed that we are currently in the branch v1 / Master -
Run git branch v1 / debug v1 / master . It only creates a label written on the same code, which is currently indicated by v1 / master . -
Once the branch is ready v1 / dev , combine it into v1 / debug . Play git checkout v1 / debug & amp; Amp; Git merge v1 / dev . -
Once the branch v1 / debug is ready, add it to v1 / master . Run git checkout v1 / master & amp; Amp; GIT Merge v1 / debug . From now on, what do you say «hierarchy» seem to appear clearly.
-
Do some work on the branch v1 / dev . Run git checkout v1 / dev and commit many more.
-
Add it to v1 / debug . Play git checkout v1 / debug & amp; Amp; Git merge v1 / dev .
-
Add it to v1 / master . Run git checkout v1 / master & amp; Amp; GT Merge v1 / debug . Now you have 3 clear branches, the desired workflow!
Note that the graph will only look like this if you use git merge --no-ff . It clarifies things in pictures, so I think merge is not fast forward , so that we can always see what happened, even if they are actually useless to merge.
Comments
Post a Comment