1

If I have multiple feature branches in git, is there a way to "merge-squash" them together before merging a single branch upstream?

 master / feature/user-groups \ / feature/web-security > feature/user-security / bugfix/country-codes / bugfix/trademark-year / 

1 Answer 1

2

Pick one of the existing branches, say feature/user-groups, and fork a new branch from it:

git checkout feature/user-groups git checkout -b feature/user-security 

Now, merge the other three branches:

git merge feature/web-security bugfix/country-codes bugfix/trademark-year 

This produces a single commit on the feature/user-security branch, whose parents lead to the four original branches.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.