Squash a merged branch
问题 I would like to know how squash all commits of merged branch like this : feature | c3 - merge_master - c6 / / \ master | c1 - c2 - c5 ------------- merge_feature - c7 and I aim to have this master | c1 - c2 - c5 - squash_c3_c6 - c7 I found that git rebase c6 c5 --onto c6 allow me to replay c3 and c6 to have c3' and c6' but I always have c3 and c6 in my history. I must do this in script to process a large repository (over 6k branches !) so I can't use git rebase -i Any idea ? 回答1: You can't