DM GitHub default branch changed to "main"

As decided in RFC-803, as of 2021-11-27 we have changed the default branch on all GitHub repositories in the lsst and lsst-dm organizations to main.

This does not affect users of the Rubin Science Platform instances, Docker containers, or eups source or binary packages.

It does affect developers who are building from clones of source repos including those who are using the lsstsw build tool. For source clones, follow GitHub’s directions to execute four commands to update the default branch in your local clone. For lsstsw users, you should only have to do this in the lsstsw clone itself, and then re-execute bin/deploy.

While Jenkins and release builds of the Science Pipelines should be back to normal, there are still some additional changes that need to occur (documented in implementation ticket DM-32648) and likely more issues that will crop up.

If there are any questions or problems, please feel free to post here or contact me.

1 Like

If you’ve got a bunch of repos in a directory, you could use something like this bash script for bulk updates:

for gg in $(find $HOME/LSST -name .git); do
    echo Working on $gg;
    git --git-dir $gg branch -m master main
    git --git-dir $gg fetch origin
    git --git-dir $gg branch -u origin/main main
    git --git-dir $gg remote set-head origin -a
done

Because I keep tripping over local repos that I’d forgotten to update, here’s the single-package conversion sequence:

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

and the optional “remove tracking references to the old branch name” final step:

git remote prune origin