opensafely / research-template

The template for new research projects that use the OpenSAFELY framework.
MIT License
16 stars 13 forks source link

Rename default branch to main #32

Closed iaindillingham closed 3 years ago

iaindillingham commented 3 years ago

Recently, @richiecroker asked why the default branch had been renamed. From the Software Freedom Conservancy:

Both Conservancy and the Git project are aware that the initial branch name, ‘master’, is offensive to some people and we empathize with those hurt by the use of that term.

And from the github/renaming repository:

Many communities, both on GitHub and in the wider Git community, are considering renaming the default branch name of their repository from master. GitHub is gradually renaming the default branch of our own repositories from master to main.

A new repository created from this template will have a default branch named master, presumably because this template's default branch is also named master. At some point, a user of the new repository will be prompted by GitHub to rename the default branch to main. As we don't expect this user to be familiar with either Git or GitHub, and so might question the prompt from GitHub, I would argue that we should rename this template's default branch to main.

That said, it would be useful to know:

iaindillingham commented 3 years ago

Renamed from master to main. The following instructions are also displayed in the UI:

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