1 © ZENIKA 2020 All rights reserved - Proprietary & confidential Git, rewrite the history Antoine Ceol

Git Back to the future… Antoine Ceol boombaprealm aceol

© ZENIKA 2022 All rights reserved - Proprietary & confidential La démo 3

⚠ Pas d’amend/rebase interactif sur des branches partagées Sinon on prends ses précautions: git push -–force-with-lease Parfois plus sage de revert git revert SHA-1 © ZENIKA 2022 All rights reserved - Proprietary & confidential On risque quoi? 4

© ZENIKA 2022 All rights reserved - Proprietary & confidential Un exemple 5

© ZENIKA 2022 All rights reserved - Proprietary & confidential

© ZENIKA 2022 All rights reserved - Proprietary & confidential

© ZENIKA 2022 All rights reserved - Proprietary & confidential

Ne plus hésiter avant de commiter Commiter plus souvent Faciliter les revues de code Trouver un bug plus facilement Rendre le monde (vaguement) meilleur l’open source (ou pas) © ZENIKA 2022 All rights reserved - Proprietary & confidential Les avantages 9

Ne plus hésiter avant de commiter Commiter plus souvent Faciliter les revues de code Trouver un bug plus facilement Rendre le monde (vaguement) meilleur l’open source (ou pas) © ZENIKA 2022 All rights reserved - Proprietary & confidential Les avantages 10

git config —global rerere.enabled true commit —fixup SHA-1 rebase —autostash rebase —autosquash rebase —exec © ZENIKA 2022 All rights reserved - Proprietary & confidential A retenir 11

🃏 Le reflog 󰙀😈 amend rebase interactif © ZENIKA 2022 All rights reserved - Proprietary & confidential A retenir 12

MERCI Antoine Ceol boombaprealm aceol © ZENIKA 2022 All rights reserved - Proprietary & confidential 13

New base Will be replaced by new base last commit rebase © ZENIKA 2022 All rights reserved - Proprietary & confidential Rebase -onto 14

Git (re)write your history