Changing master branch to main -- DONE!


Larry Gritz
 

OK, the deed is done: OSL's "master" branch has been renamed to "main".

There are three things you need to do:

1. If you have a fork of OSL on GitHub, when you visit the fork on the web, GitHub will have a handy pop-up reminding you that the branch has changed on our repo. It's easy to also rename the branch on your fork: Just click the "branches" button, click the little pencil icon next to your "master" branch to edit, and you will see a dialog about renaming.

2. For any of your local branches, do this to rename the branch locally:
	git branch -m master main
	git fetch origin
	git branch -u origin/main main
	git remote set-head origin -a
If you have multiple remotes, you will need to do the same commands, but for your other remote name where this says "origin".

3. If you have any scripts or downstream projects that clone or pull from our "master" branch, you will have to edit the script to say "main". (References to any other tags or branch names will, of course, not change.)

Apologies if this causes any confusion or inconvenience. Please alert us here if there's any trouble, so that others can see what you did to fix it. Hopefully this will go smoothly for everybody; it was pretty easy for me on my machine.



On Nov 4, 2021, at 10:45 PM, Larry Gritz <lg@...> wrote:

Following in the footsteps of git itself, GitHub, GitLab, OpenColorIO, and likely the rest of the ASWF projects fairly soon, the OSL technical steering committee has decided to go ahead with renaming our development branch from "master" to "main."

We're planning to throw the switch on Sunday, Nov 7.

The branch renaming action on GitHub automatically takes care of quite a bit of housekeeping for us, including retargeting branch references for outstanding PRs, as well as automatically redirecting web browsing that referenced master, to go to main. If you have a fork of OSL on GitHub, next time you visit it, GH will automatically give you instructions for how to change the name on your fork as well.

Those of you with local clones of the repo will need to issue a few commands to change branch names locally; you can find the instructions for doing so on this handy guide from the OpenColorIO project:
https://docs.google.com/document/d/10UjPQW088rqWimQ1k1ByYThCuHBlVFcXaDD-kO6At1w
But in short, this is what you'll need to do:

git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a

Then the only other thing to clean up is if you have any scripts for downloading and building OSL that explicitly try to pull from or check out the master branch. Unfortunately, GitHub does not automatically redirect *git* protocol references from the old branch name to the new one. Those will need to be edited on your end to refer to main.

I'll remind everybody again about this after I do the deed on Sunday. I'm just trying to make sure everybody knows what's coming and what will be required.

If anybody thinks this will be a *major* disruption at an inconvenient time and wants to argue for postponing it for a short time to give you more time to prepare, please speak up now.


--
Larry Gritz
lg@...










--
Larry Gritz