You have worked on a new feature called Hello World. This features ends up being complete with both documentation and unit test, but there are a few problems. The history looks really messy, with lots of small half-finished steps, and there are things included that should never have been there.
You should fix this such that your git log
looks great!
To do this we will use our good friend git rebase --interactive
Luckily we have a release tag v0.0
from just before we started the feature.
As this is an advanced exercise, there are no specific steps to follow and no single solution.
- Run
source setup.sh
(or.\setup.ps1
in PowerShell)
- Explore the repo and the history so you know what happened
- Use
git rebase --interactive v0.0
to let you edit the "recipe" for the entire feature development. - Clean up the history such that it actually makes sense. Try to use as many of the rebase "features" (e.g. reword, squash, fixup, drop) as possible. You decide yourself if you want to rewrite the whole thing in one go, or apply a few changes first, then run a new
git rebase --interactive v0.0
to keep cleaning.
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 rebase -i <ref>
# run the interactive rebase back to