Hacker News new | ask | show | jobs
by ajross 808 days ago
Yeah, "all branches are remote" is in fact the Objectively Best Workflow.

In point of fact I don't deal with local branches at all on 95%+ of days. Just "git reset --hard <remote>/<branch_to_work_on>", do whatever I want, and then "git push <remote> HEAD:refs/heads/<pull_request>" (or push -f if I'm reworking an existing one, yada yada). If I want to "pull" changes I just "git fetch <remote>" and don't ever bother checking anything out.

Local branches involve too much state that inevitably means I trip over it.

1 comments

Heartily agree! I never thought of my workflow in this way, but it makes sense: by completely avoiding local branches, I reduce my cognitive load. I only ever work from "master", but my "master" is just whatever I happen to be working on that day.