Are there any real differences between using "fixup!" or squash!

I read the git documentation on commit and rebase , but I still don't understand the difference between using fixup!or squash!as a prefix for a commit message at runtime rebase --autosquash. I believe that I understand what correction of previous commitsfixup! does in terms , but I don’t see a good example where it is used instead . Can someone clarify the difference between them and give some context where they will be used in different ways? Thanks in advance!squash!squash!

+4
source share
1 answer

As I illustrated in the section " Trimming Git Commits / Squashing Git History " and summarizing:

with the fix! you could keep this message “invisible” in the commit message while retaining the ability to automatically forward the commit using the option--autosquash

As Op Dash comment :

Use squash!ensures that a crush operation is recorded in the history, which is different from fixup!where the squash operation is invisible for a cleaner approach.


Another difference before Git 2.16.x / 2.17 (Q1 2018) is that you could not combine the " git commit --fixup" with the extra commit message.
This is no longer the case.

. 30884c9 (22 2017 .) Ævar Arnfjörð Bjarmason (avar).
: (sunshineco).
( Ævar Arnfjörð Bjarmason - avar - 30884c9, 22 2017 .

commit: --fixup <commit> -m"<extra message>"

-m --fixup.
( " -m " ) , --fixup.
--edit .

:

  • --fixup commit, , .

  • (Ab), --fixup, , , -,
    .. "this should have been part of that other commit", - , .

,
   "forgot this part, which broke XYZ".


, Git 2.17 (Q2 2018) "git commit --fixup" "-m<message>" ; .

. 30884c9, f55e84f ( 22 2017 .) Ævar Arnfjörð Bjarmason (avar).
: (sunshineco).
( - gitster - c1ab3b8, 27 2018 .

commit: --fixup <commit> -m"<extra message>"

-m --fixup. --fixup. --edit .

:

  • --fixup commit, , .

  • (Ab), --fixup, , , , .. , " ", - , .

    , " , XYZ".

--fixup <commit> -m"More" -m"Details" :

!fixup <subject of <commit>>

More

Details

--fixup , -m " -c, -c -F, --fixup ( commit d71b8ba," commit: --fixup rebase --autosquash ", 2010-11-02, Git 1.7.4-rc0)).

+4

Source: https://habr.com/ru/post/1653176/


All Articles