luceneutil icon indicating copy to clipboard operation
luceneutil copied to clipboard

rename master branch in git

Open msokolov opened this issue 3 years ago • 4 comments

What would it take to rename this branch? Does anything rely on the name, aside from people's existing checkouts? I think we could just create a new branch named say "main" and delete "master"? Then people's checkouts will be tracking a nonexistent remote branch, and they will have to fix that.

msokolov avatar May 22 '22 15:05 msokolov

+1!

We probably need a small fix to nightlyBench.py, where it pulls updates before running each night, and also where it generates URLs to see code changes since the last run in the charts, but otherwise this shouldn't be a big deal?

Maybe developers will have to re-clone to switch to the new name? Not sure.

mikemccand avatar May 22 '22 16:05 mikemccand

I think developers could switch by:

> git fetch
... get the new main branch
> git branch -m main
> git branch --set-upstream-to origin/main
> git prune
... remove local references to the deleted upstream branch? maybe?

msokolov avatar May 22 '22 19:05 msokolov

hmm your mention of URLs in charts makes me wonder if we shouldn't keep the master branch around even if it's deprecated. Maybe there are published charts with URLs containing the branch name in them somewhere? Or -- wouldn't they be more likely to have the commit ids?

msokolov avatar May 22 '22 19:05 msokolov

My fork shows a "rename" button here: https://github.com/msokolov/luceneutil/branches maybe yours would do that for you?

msokolov avatar May 22 '22 20:05 msokolov