I'd like to merge my feature-branch into my develop-branch, but squash some commits into 1, while pulling in others as-is. Is there a possibilty to git merge --squash feature and then to choose which commits from the feature-branch should be squashed and which taken as-is?
1 Answer
Nah. You must use interactive rebase in order to do pick, delete, squash etc.
git rebase -i HEAD~4 Will let you decide on the four last commits.
2 Comments
quaylar
This has to be done on the feature-branch? So this would rewrite history of the feature-branch to just contain the commits i desire. Subsequently i could rebase my develop branch on the feature branch to pull in these commits - correct?
ralphtheninja
Yup you would do this on the feature-branch. But I probably would rebase my feature branch on the develop branch, assuming the feature branch is branched off from the develop branch that is.