merge - git abandon master branch -
In my git repository I have created a new branch called alt. After some work it seems that Alt is my master In the branch, I want to leave the master and I want to make a new master.
C1 | C2 / \ Master - & gt; C3C4 | C5 and LT; - alt So I want to sacrifice C3, but still want to put it in the history committed for future reference and return to one branch. What is the best way to do this?
My first thought is to transfer the master from C5, and then to merge the Alt in the master. is this correct? Do I need to move the master first?
I can also merge master to Alt, solve all the merge tribs by placing the version of Alt, and then rename it to master Alt.
Or should I take the master to Alt and just remove the branch alt, leave the C3 as a fragmented branch, which is actually a reality?
I think there are many solutions here, there is a best practice to follow (always return branches to velvety vs open-ended)
I think the easiest way to merge the ours strategy to the owner, it creates a new comment C6, which is similar to the C5, -C3 and C5 in the form of a wife, thus keeping C3 in the repository. git checkout alt git merge --strategy = remove our master # merge GIT checkout master GIT merge - alt alt # level master alt git branch -d alt # delete alt it is no longer necessary Instead of merge, if you want a linear history, you should also be able to rebase. Just replace the first two rows with git rebase --strategy = ours alt master . Please enter each order that you enter. I have not tested this. Of course, git is going on, nothing is lost if something goes wrong ...
Comments
Post a Comment