/ git

Git squash feature branch commits

Quite often, you don't need all the commits in a feature branch after its done and dusted and ready to be merged to master.

I believe you can do git rebase -i master from the feature branch, or better, git merge --squash feature_branch from master. [see]

git merge --squash feature_branch "fetches" all commits from feature branch but doesn't make any commits or merge.

Just commit as usual by doing git add . and git commit -m "xxx done".

Git squash feature branch commits
Share this