What is the difference between squash and fixup in Git / Git Extension?

I used Git Extensions for a while (this is great!), But I did not find a simple answer to the following:

Sometimes, when entering a commit message, create a typo. My friend showed me how to fix this as follows (in Git Extentions):

Right-click commit> Advanced> Commit commit

enter image description here

Then I just check the "Change" box and rewrote my message and voila! My commit message is fixed.

However, this other version of "Squash commit" ... I always wondered what it does ?!

My question is:

Someone just explain to me what exactly is the difference between Squash commit and Fixup fixing in Git / Git Extentions ? They look somehow "similar" to me: enter image description hereenter image description here

+61
git squash git-extensions difference fixup
May 26 '13 at 10:01
source share
4 answers

I don't know what Git Extensions does with it specifically, but Git rebase has the ability to automatically squash or commit compilation with squash! or fix! prefixes, respectively:

--autosquash, --no-autosquash When the commit log message begins with "squash! ..." (or "fixup! ..."), and there is a commit whose title begins with the same ..., automatically modify the todo list of rebase -i so that the commit marked for squashing comes right after the commit to be modified, and change the action of the moved commit from pick to squash (or fixup). 

The difference between squash and fixup is that during rebase, the squash operation will prompt you to combine the original messages and the squash commit, while the fixup operation will save the original message and undo the message from the fixup commit.

+82
May 26 '13 at 11:11
source share

Simply put, when overwriting a series of commits, each commit marked as squash gives you the option to use its message as part of a pick or reword .

When you use fixup , the message from that commit is discarded.

+37
Jul 11 '14 at 14:20
source share

From git -rebase doc :

If you want to reset two or more commits into one, replace the "select" command for the second and subsequent commit using "squash" or "fixup". If the commits had different authors, the folded fixer will be assigned to the author of the first commit. The proposed commit message for a folded commit is a combination of the commit messages of the first commit and those who have the squash command, but omit commit commit messages using the fixup command.

+6
Mar 12 '15 at 13:48
source share

I was messing around with git extensions and couldn't get it to crush many commits into one. To do this, I had to resort to the command line and find this post useful

 git rebase -i Head~2 

This is an interactive reboot and note the following:

  • ~ 2 here refers to the number of commits that you want to use in this operation, including the current head
  • You need to edit the interactive subtask editing window, leave the first pick element and replace the subsequent squash lines. The instructions in the link above are much clearer if it is opaque.
0
May 08 '15 at 17:15
source share



All Articles