Puhlze
Puhlze

Reputation: 2614

Git - how to merge additional branch changes after branch has been 'merge --squash'ed

Situation: I have a topic branch which has been squashed into master. I then added some additional commits to the topic branch and want to merge these additional commits into master. Is there any way to do this?

Graph:

master A - B - F

             \

topic          C - D - E (squashed into F) - G - H

Question -- How to get G and H onto F?

My takeaway from Rebasing after squash merge? has been to update the topic branch parent after a squash so as to avoid this situation all together. My solution for now to unstick myself has just been to create a patch containing my new changes and apply this patch to master, but I'm losing commit history doing this, so it's not ideal.

Thanks!

Upvotes: 1

Views: 87

Answers (2)

forvaidya
forvaidya

Reputation: 3315

merge again.

squash or no-squash both will work. no squash will create merge commit.

Upvotes: -1

Stephan
Stephan

Reputation: 1657

if I understand you correctly the way of doing this is cherry-picking: https://ariejan.net/2010/06/10/cherry-picking-specific-commits-from-another-branch

Upvotes: 2

Related Questions