git - How can I rebase from specific develop branch commit to specific master branch commit -
i have master branch this:
a->b->c->d->e
the develop branch this:
a->b->c->d->e->f->g->h->i ^ |- should used
i want apply g
on top of d
. how can this?
i tried this:
git checkout develop git rebase 82c7b6a
but giving me merge conflicts.
my main goal keep master branch , delete develop branch.
main: a->b->c->d->g->h->i
i cherry-pick 1 commit.
git checkout master git cherry-pick g git cherry-pick h (edit 3) git cherry-pick (edit 3) git branch -d develop
edit
i didn't see don't want e. be:
git checkout master git reset --hard head^1 git cherry-pick g git cherry-pick h (edit 3) git cherry-pick (edit 3) git branch -d develop
edit 2
more failsafe solution pointed out @ckruczek use rebase interactive.
git checkout master git reset --hard develop git rebase -i d git branch -d develop
and remove lines commits don't want have.
edit 4
as history rewrite might serious trouble using upper approaches.
i recommend solution like:
a->b->c->d->e->!e->g->h->i
to do: git checkout master git revert e git cherry-pick g h git branch -d develop
Comments
Post a Comment