status # review our work git diff git commit -m "abc works now" -a git push ...code up a new test... git add tests/test_abc.py git commit -m "add a test too" git fetch # get any master changes from origin git rebase -i origin/master # rebase against those changes git push --force # warning -- force pushing is dangerous git checkout master git pull # merge origin changes into local master git merge fix-abc git push how I typically use git. See shell session recording
git commit --patch move individual commits around quickly move changes aside - but why not commit? revert - you can't go back in time (not without destroying stuff) - instead, new commit which is reverse of prior commit commit chunks at a time, make separate cohesive commits
last commit git reset [...] # various types, soft, hard git rebase --abort # quit a rebase git merge --abort # quit a pull with conflicts "checkout" is overloaded :( a pull is a fetch+merge, conflicts mean somebody force-pushed, need to use reset