2

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 1

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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?
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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.