In git, what is the difference between merge --squash and rebase?
问题 I\'m new to git and I\'m trying to understand the difference between a squash and a rebase. As I understand it you perform a squash when doing a rebase. 回答1: Both git merge --squash and git rebase --interactive can produce a "squashed" commit. But they serve different purposes. git merge --squash abranch will produce a squashed commit on the destination branch, without marking any merge relationship. (Note: it does not produce a commit right away: you need an additional git commit -m "squash