Cliffnotes version
- Assume I want to run this command:
git cherry-pick ABC..XYZ
. I wantABC
to be included in my commits to the current branch. Do I have to reference the commit beforeABC
?
Long Version
- So I have branches
master
,Apple
andNewApple
. Apple
was built upon a very old version ofmaster
but only worked on a dozen files which were implemented on folders which the rest of themaster
did not really touch.Apple
has commitsABC
,BCD
, andXYZ
. These are commits unique toApple
. Please note there are about 10 commits betweenBCD
andXYZ. These commits were NEVER commited to
master`- So I made a new branch
NewApple
which is spun off of a newer versions ofmaster
, ones with newer commits. - Then I cherry-picked commits from
Apple
to put ontoNewApple
like sogit cherry-pick ABC..XYZ
- However, when finished and committed to my remote repository, I noticed that
ABC
was not included. Everything after it and includingXYZ
were put ontoNewApple
. - I want to be able to commit
ABC
as part of my cherry-pick without referencing the commit that is before it inApple
. I am afraid that if I do, I won't get all the commits inApple
or it will try to merge in random oldermaster
commits on top of newer versions of master.