# you are in a branch2 which has multiple commits which you want to combine into 1 and merge into branch1 git rebase <branch_to_merge_into> -i pick and squash the commits you want