6. CHANGING HISTORY Flashcards
AMENDING USE EXAMPLE
You can often end up committing something that’s not quite right. You can create a new commit, but that ends up creating a messy history with a commit for a simple fix.
¿WHAT TO USE AMENDING FOR?
To add things to the last commit, you can use the amend flag. And when you do that, it’s going to launch your default editor and allow you to edit the file with the amended history.
AMEND USE
Usage: git commit –amend
es una manera práctica de modificar el commit más reciente. Te permite combinar los cambios preparados con el commit anterior en lugar de crear un commit nuevo.
¿WHAT IS REBASING?
Rebasing is another way of changing history, and it’s designed to take the commits from one branch and apply them to another.
So we can say git rebase, and I want you to rebase by moving back to a certain number of commits. But that’s useful if you have an extremely long commit history and you’ll only want to go back a few steps.