My workflow is generally
git checkout -b topic
- Work on code, committing at various times.
- Run automated tests. Go back to working on code if a test fails.
git rebase -i master
to squash related commits.git checkout master
git pull
git rebase master topic
- Fix merge conflicts
- Run automated tests. Go back to working on code if a test fails.
git checkout master
git merge topic
git branch -d topic
git push
If this fails, go back to git pull
, except working in the master branch rather than the topic branch.
And I do this from a shell within emacs. For the longest time, if I really wanted to do the
git rebase -i
, I'd open a new window and do the rebasing in vi, so I generally skipped that step and just had a bunch of commits with identical log messages sometimes interleaved with other commits. But then I figured that was just dumb and changed my .emacs file for the first time in over 5 years, adding
(setenv "EDITOR" "/usr/bin/emacsclient")
(server-start)