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

StackOverflow https://stackoverflow.com/questions/14526045

  •  05-03-2022
  •  | 
  •  

문제

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!

도움이 되었습니까?

해결책

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

다른 팁

merge again.

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top