When we are working, we make a lot of commits. Sometimes we just forget something obvious that we want to fix quickly.
git commit --amend
allows us to do that - tinker with the last commit we made.
- Run
. setup.sh
(or.\setup.ps1
in PowerShell)
- What does
git status
tell us? - What does
git log
tell us? - Stage the addition of bar.txt
- Run
git commit --amend
- What happened? What does
git log
tell us? - What happens if you run
git commit --amend
again?
git add
git log --oneline --graph
git commit --amend