08 DECEMBER 2019 /
Watching the youtube video A Branch in Time (a story about revision histories) by Tekin Süleyman provided invaluable insight on how to git better.
Git commit histories can be revised to better organise repos and to easily find details on why choices were made.
Your software is more than the code — Tekin Süleyman
The commands to use to edit commit messages are summarised below
To revise commit history:
git rebase -i master
When editing commit messages:
Change previous commit, add changes, use --no-edit to use without new commit message:
git commit --amend
To force push to branch:
git push --force-with-lease
git commit -m 'Message')
git config --global core.editor "subl -w" and turn verbose on git config --global commit.verbose truegit add --patch / -pgit commit —amend
—fixup / —autosquash
git rebase —interactive
git rebase —abort
git log -S "some_code"
git annotate file
squashgit rebase -i masterreword or pickgit log --onelinegit push --force-with-lease 🥳Kerry Parker
Data Engineer with PhD in Physics. Interested in all things data, personal development and productivity, see more posts on Medium.