Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sometimes you end up with a random mishmash of repos, some with the default branch called "master", others with it called "main", and then a handful with something else altogether (e.g. "develop"). Someone pushes for a massive "master=>main" rename – but once you get "master" baked into umpteen dozen ultra-complex CI/CD/testing pipelines, etc, it takes a lot of time to change them all and deal with all the fiddly breakage that results. So people do the rename for brand-new projects, and some of the low-hanging fruit of the existing ones, but the "too obscure" or "too-big-to-deal-with" existing projects get put off indefinitely. And then you are constantly scratching my head trying to remember which one this repo is. Even worse, a few repos someone creates a new "main" branch but keeps an old outdated "master" branch around just to confuse people. Even if your organisation has been so diligent as to finish off the rename everywhere, sooner or later you need to make changes to some open source project you are using which hasn't.

What Git really needs, is some kind of "branch alias" feature. Some config setting like "branch_alias.main=master", and then I could always write "git checkout main", and it would checkout "main" if that exists, and "master" if it didn't (and vice versa). That would solve it in most cases – except for the rarer "we decided to use neither main nor master" and "we made a new main branch but kept an outdated master branch hanging around".



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: