3

I have two main branches, staging and master. I have a few commits and I have pushed those changes to a branch say xyz whose base branch is staging and have created a pull request for staging branch. All these commits has been squashed into a single commit.

Is it possible to cherry pick this squashed commit and apply this cherry pick to a new branch started from master, so that I can create the same pull request to master branch also.

Nidhin S G
  • 1,685
  • 2
  • 15
  • 45

1 Answers1

6

Is it possible to cherry pick this squashed commit and apply this cherry pick to a new branch started from master

Yes: git cherry-pick <sha of squashed commit>

Philip Pittle
  • 11,821
  • 8
  • 59
  • 123
  • I see that squashed commits also have parents so this solution doesn't seem to work for me. – user1870400 Aug 11 '18 at 18:24
  • @user1870400 - you can cherry pick multiple commits, but you'll need to run `cherry-pick` for each commit you want moved, one at a time, and in the order you want them applied (generally oldest first) – Philip Pittle Aug 13 '18 at 08:23