Pull request on a branch which got cherry picked commits merged
up vote
2
down vote
favorite
I initiated a feature development in BranchA, but I included some 'clean up' and 'tweaking' commits on it.
In the middle of the process 'tweaking' commits needed to be merged into the master (by doing a pull request) so I created a BranchB with some new commits and cherry picked some of the commits done in BranchA.
BranchB was merged with no conflicts.
My question is: How to handle the BranchA pull request?
Is it safe to submit BranchA even if some of its commits were already merged? If not, how to go through this situation?

git github rebase git-cherry-pick
add a comment |
up vote
2
down vote
favorite
I initiated a feature development in BranchA, but I included some 'clean up' and 'tweaking' commits on it.
In the middle of the process 'tweaking' commits needed to be merged into the master (by doing a pull request) so I created a BranchB with some new commits and cherry picked some of the commits done in BranchA.
BranchB was merged with no conflicts.
My question is: How to handle the BranchA pull request?
Is it safe to submit BranchA even if some of its commits were already merged? If not, how to go through this situation?

git github rebase git-cherry-pick
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I initiated a feature development in BranchA, but I included some 'clean up' and 'tweaking' commits on it.
In the middle of the process 'tweaking' commits needed to be merged into the master (by doing a pull request) so I created a BranchB with some new commits and cherry picked some of the commits done in BranchA.
BranchB was merged with no conflicts.
My question is: How to handle the BranchA pull request?
Is it safe to submit BranchA even if some of its commits were already merged? If not, how to go through this situation?

git github rebase git-cherry-pick
I initiated a feature development in BranchA, but I included some 'clean up' and 'tweaking' commits on it.
In the middle of the process 'tweaking' commits needed to be merged into the master (by doing a pull request) so I created a BranchB with some new commits and cherry picked some of the commits done in BranchA.
BranchB was merged with no conflicts.
My question is: How to handle the BranchA pull request?
Is it safe to submit BranchA even if some of its commits were already merged? If not, how to go through this situation?

git github rebase git-cherry-pick
git github rebase git-cherry-pick
edited Nov 10 at 1:28
VonC
822k28425813100
822k28425813100
asked Nov 9 at 21:59
NirajBlue
155
155
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
Rebase branch A on B: only the commits not cherry-picked should be there.
B--B--B--B--A'--A'--A' (A)
m--M--m--m (master)
Then rebase A on top of master:
git rebase --onto master B A
That will rebase all commits after B HEAD, up to A HEAD (included).
B--B--B--B (B)
m--M--m--m (master)
A''--A''--A'' (A)
From there, you can make your pull-request.
I did it like this:git checkout master && git fetch upstream && git merge upstream/master && git checkout BranchA && git rebase BranchB && git rebase master
– NirajBlue
Nov 12 at 19:27
@NirajBlue That should work, well done.
– VonC
Nov 12 at 20:07
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Rebase branch A on B: only the commits not cherry-picked should be there.
B--B--B--B--A'--A'--A' (A)
m--M--m--m (master)
Then rebase A on top of master:
git rebase --onto master B A
That will rebase all commits after B HEAD, up to A HEAD (included).
B--B--B--B (B)
m--M--m--m (master)
A''--A''--A'' (A)
From there, you can make your pull-request.
I did it like this:git checkout master && git fetch upstream && git merge upstream/master && git checkout BranchA && git rebase BranchB && git rebase master
– NirajBlue
Nov 12 at 19:27
@NirajBlue That should work, well done.
– VonC
Nov 12 at 20:07
add a comment |
up vote
2
down vote
accepted
Rebase branch A on B: only the commits not cherry-picked should be there.
B--B--B--B--A'--A'--A' (A)
m--M--m--m (master)
Then rebase A on top of master:
git rebase --onto master B A
That will rebase all commits after B HEAD, up to A HEAD (included).
B--B--B--B (B)
m--M--m--m (master)
A''--A''--A'' (A)
From there, you can make your pull-request.
I did it like this:git checkout master && git fetch upstream && git merge upstream/master && git checkout BranchA && git rebase BranchB && git rebase master
– NirajBlue
Nov 12 at 19:27
@NirajBlue That should work, well done.
– VonC
Nov 12 at 20:07
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Rebase branch A on B: only the commits not cherry-picked should be there.
B--B--B--B--A'--A'--A' (A)
m--M--m--m (master)
Then rebase A on top of master:
git rebase --onto master B A
That will rebase all commits after B HEAD, up to A HEAD (included).
B--B--B--B (B)
m--M--m--m (master)
A''--A''--A'' (A)
From there, you can make your pull-request.
Rebase branch A on B: only the commits not cherry-picked should be there.
B--B--B--B--A'--A'--A' (A)
m--M--m--m (master)
Then rebase A on top of master:
git rebase --onto master B A
That will rebase all commits after B HEAD, up to A HEAD (included).
B--B--B--B (B)
m--M--m--m (master)
A''--A''--A'' (A)
From there, you can make your pull-request.
answered Nov 10 at 1:27
VonC
822k28425813100
822k28425813100
I did it like this:git checkout master && git fetch upstream && git merge upstream/master && git checkout BranchA && git rebase BranchB && git rebase master
– NirajBlue
Nov 12 at 19:27
@NirajBlue That should work, well done.
– VonC
Nov 12 at 20:07
add a comment |
I did it like this:git checkout master && git fetch upstream && git merge upstream/master && git checkout BranchA && git rebase BranchB && git rebase master
– NirajBlue
Nov 12 at 19:27
@NirajBlue That should work, well done.
– VonC
Nov 12 at 20:07
I did it like this:
git checkout master && git fetch upstream && git merge upstream/master && git checkout BranchA && git rebase BranchB && git rebase master– NirajBlue
Nov 12 at 19:27
I did it like this:
git checkout master && git fetch upstream && git merge upstream/master && git checkout BranchA && git rebase BranchB && git rebase master– NirajBlue
Nov 12 at 19:27
@NirajBlue That should work, well done.
– VonC
Nov 12 at 20:07
@NirajBlue That should work, well done.
– VonC
Nov 12 at 20:07
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233783%2fpull-request-on-a-branch-which-got-cherry-picked-commits-merged%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown