main branches locally
main branches locally
Posted Oct 23, 2025 17:59 UTC (Thu) by Wol (subscriber, #4433)In reply to: main branches locally by josh
Parent article: Git considers SHA-256, Rust, LLMs, and more
So you basically want to save about 20 bytes of on-disk space? And get rid of one line from the display of git branches?
> The workflow is "update origin, create new feature branch from origin/main, make commits, push feature branch to fork, create PR for fork, delete branch when PR is merged". At no point in that process is my fork's main branch useful in any way.
For which you need the main branch to exist. Otherwise, when upstream actions the pull request, how does it know what exactly to pull?
Bear in mind your repository is (unless you did a shallow clone) a copy of the *complete* repository with everything including everybody else's feature branches and everything (until they are pruned). So the cost of that tiny file saying "this is where remote origin/master/HEAD was when local origin was updated" is tiny. The cost of deleting the master branch depends on what you mean by "master branch". If you mean that file, your branch suddenly becomes the entire repository because you know longer have any way of knowing what exactly exists on your system and what exists upstream. If however you mean the entire master branch itself, you've just deleted most of your project, and it will no longer build because all of upstream code has disappeared ...
What problem do you *actually* have with the master branch, other than you think it's visual clutter? Whatever you call it, from the PoV of the project as a whole, a master branch is an absolute necessity.
Cheers,
Wol
