You have worked on a new feature called Hello World. This features ends up being complete with both documentation and unit test, but there is a typo in the documentation.
You need to fix it and then rebase to have a beautiful history.
Luckily we have a release tag v0.0
from just before we started the feature.
There is a way to easily fix it with advanced options for git commit
and git rebase
.
- Run
. setup.sh
(or.\setup.ps1
in PowerShell)
- Explore the repo and the history so you know when the documentation file was added.
- Fix
README.md
file and add it. - Add your commit by using
git commit --fixup=<commit id to be fixed>
. - Use
git rebase --autosquash --interactive v0.0
to view the rebase recipe automatically generated. - Use
git log
to view your new beautiful history.
ls -l
# list filestail -n +1 *
# show content of all filesgit log --oneline
# show historygit log --stat
# log which files changedgit log --patch
# log with diffgit show <commit id>
# show changes of a commitgit add
# add filegit commit --fixup=<commit id>
# commit by autogenerating the messagegit rebase -i <ref>
# run the interactive rebase back to and automaticaly reorder commits