I've been reading a little about --squash
ing commits, but they all seem to be go hand in hand with a --rebase
.
I have a feature branch with a set of commits like this:
(Feature) A --> B --> C --> D --> E --> F --> G
/
(Master) M1 --> M2 --> M3
Suppose I want to merge back to the Master
branch, but I want to clean up the commits on my feature first.
Is it possible to:
- Pick commit B, E and F and squash them together as one commit?
OR
- Can I only squash the commits that come in order, so squash: (A, B and C), or squash (D, E and F) etc?
Either way, can I do a squash directly on my feature, WITHOUT immidiately initializing a Merge
or Rebase
with it?
If so, how can I do this with Git?