git - How can I move a set of commits from master to a separate branch? -
I have a series that relates to a special feature (20 +) which I try to remove from my master branch. And I am in a different branch.
I have a tag ( rel_2009_07_18
) committed to represent the latest stable release, so when on guru, git log rel_2009_07_18
.. HEAD I set the commitment that I want to go to a different branch, there should be some command in this set, but I can cherish them because they are few.
I have seen the git filter-branch, but in the command option it is mentioned that leaving the commit but removing commit - definitely do not want to do this. I also saw the GIT Rebase, but he also mentioned the upstream broch to reuse the committee.
Is there any good option to take these cones to a different branch?
I'm not sure that this is a viable option and results in delivery, although small (3 developers), environment but I can execute the following small shift ...
- Change the name of the master locally to master_plus_feature (or similar ...)
- Checkout from the `rel_2009_07_18` tag
- From this point a new branch master
- Delete remote branches and push again from local
Ideas and su Wow Thanks!
You write that you want to 'remove' master from Remove . If the 'Master' branch has been published (well, after the rel_2009_07_18
is published), and someone can create this problem on the basis of their work on their 'master' . But maybe this is not a problem in your case.
The two solutions below assume that you have not made changes
if you can rewind 'master' branch:
Now the 'master' is on the rel_2009_07_18
tag, and 'different branch' is where 'master' 'The final result is exactly the same as the set of steps you have proposed (changing the name of' Swami 'to' separate_bank ',' master 'to rel_2009_07_18
Only difference is in the reflogs.
If you can not rewind the 'master' branch
> $ git checkout master $ git branch separate_branch $ git checkout rel_2009_07_18 - $ Git clean-df $ git commit -m 'rel_2009_07_18' returned to the state '
Note that this solution has not been tested! YMMV.
Comments
Post a Comment