Drew Devault's unorthodox, branchless git workflow ↦
In short, I use git branches very rarely, preferring to work on my local master branch almost every time. When I want to work on multiple tasks in the same repository (i.e. often), I just… work on all of them on master. I waste no time creating a new branch, or switching to another branch to change contexts; I just start writing code and committing changes, all directly on master, intermixing different workstreams freely. This reduces my startup time to zero, both for starting new tasks and revisiting old work.
If the blog post ended here, you might think Drew is crazy. But he goes on to explain how he uses rebase to clean things up before pushing upstream.
I enjoy hanging out on master quite a bit, myself. However, when I’m ready to take on something “big” or “gnarly” I don’t hesitate to
git checkout -b and work from there.
Sign in or Join to comment or subscribe
Unorthodox, maybe, but not uncommon, I presume. Thanks for sharing; more people should learn about this workflow. 👍
In my team of five we share the maintenance of a private repository, and on top of working like this locally, we also share the set of currently floating patches on a remote branch, taking care to always
git push --force-with-lease, so we don’t remove anyone else’s patches from the remote.