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 true
git add --patch / -p
git commit —amend
—fixup / —autosquash
git rebase —interactive
git rebase —abort
git log -S "some_code"
git annotate file
squash
git rebase -i master
reword
or pick
git log --oneline
git push --force-with-lease
🥳Kerry Parker
Data Scientist with PhD in Physics. Interested in learning, software development and productivity, see more posts on Medium.