I’m trying to use the git merge –squash with the –no-ff parameter, but git does not allow.
Someone have any sugestion to help me?
I can’t use fast forward merge and I need to use the –squash parameter to group a lot of commits that were made in another branch.
Thanks!
It probably doesn’t let you because such a command wouldn’t make sense.
The documentation for
--squashsays (emphasis mine):The
--no-ffflag does:You are essentially asking git to make a commit and NOT make a commit at the same time.
If you want to preserve all of the history of your branch, you should use the
--no-ffflag. Commit d is a merge commit that has two parents, a and c.If you want all of the commits on that branch to be treated as a single unit of work, then use
--squash. Commit d is a regular commit that contains all of the changes from commits b and c but has only one parent, a.