Comment by ajross

2 days ago

And that sounds like you failed to understand me. I didn't say "don't use branches". I said "all branches are remote". Pushing to a branch is communication with other human beings. Mixing your own private state into that is confusing and needless in 99% of situations (and the remaining 1% is isomorphic to "you're a maintainer curating branches for pushing to other people at a well-known location").

All branches are public.

I have quite a few projects that do not have a "remote" and will probably never have a remote repo. Should I not be using branches at all?

> All branches are public.

What actual problem does this solve? For me, WIP branches only ever get pushed up if at least one of two things are true about them:

1) They're actually worth preserving, and not some experimental garbage that ended up being totally pointless.

2) I need to get them off of my local machine for disaster-recovery purposes.

> If you need to manage local state, do it manually with tags (or stash, but IMHO I never remember what I stashed and will always make a dummy commit and tag it).

I don't see the benefit one gets from putting work that's not fit for publication in a dummy commit on a public branch. That's just asking for garbage that noone should concern themselves with to accidentally get pushed up at the end of a long-ass day.

  • > 1) They're actually worth preserving, and not some experimental garbage that ended up being totally pointless.

    That seems naive. You don't know what's pointless for years, usually. Can I tell you how many times I've gone back to stale pull requests and topic branches to recover "How did I do this?" code?

    > 2) I need to get them off of my local machine for disaster-recovery purposes.

    That's called a "backup", and yes, data robustness is a big advantage of this workflow. You're acting like this is some kind of rare event. I push my local work to a branch (or three) on github every hour!

    A corrolary is hardware independence, btw. Working off remote branches means I can also stand up a replacement development environment with a simple clone. (And the corrolary to that means that I can trivially document this such that other people can stand up development environments for my stuff, too!)