publiclab / plots2

a collaborative knowledge-exchange platform in Rails; we welcome first-time contributors! :balloon:
https://publiclab.org
GNU General Public License v3.0
957 stars 1.83k forks source link

Moving from `master` to `main` branch name convention across all Public Lab projects #8077

Closed jywarren closed 4 years ago

jywarren commented 4 years ago

Hi, all! We've been in the midst of a years-long series of migrations from using a branch called master as default to main, and although we've succeeded for many of our repositories (https://github.com/publiclab/mapknitter/, https://github.com/publiclab/spectral-workbench/, for example, full list at bottom), we haven't done the plots2 repo yet. This is important because of the racist connotations of the term master.

One complicating issue that's slowed us in the past is that it requires re-assigning all PRs to the new default branch. But there is now (recently) a feature for this in GitHub:

Screen Shot 2020-06-24 at 4 15 57 PM

Let's start this process -- I've just reassigned the default to main and we should be able to re-assign all PRs accordingly. We're planning to begin this next week.

Thanks, all!


UPDATING LOCAL CLONES

(via this link, thanks!)

If someone has a local clone, then can update their locals like this:

$ git checkout master
$ git branch -m master main
$ git fetch
$ git branch --unset-upstream
$ git branch -u origin/main
$ git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main

The above steps accomplish:

  1. Go to the master branch
  2. Rename master to main locally
  3. Get the latest commits from the server
  4. Remove the link to origin/master
  5. Add a link to origin/main
  6. Update the default branch to be origin/main

Note: dependabot auto-repoints its own PRs, actually, and if main and master are synced, no Travis re-runs are needed.

Note: protected branches need reconfig each time!


This is done for several, including:

jywarren commented 4 years ago

Great! Done - now just repointing PRs!

jywarren commented 4 years ago

All PRs repointed! We're done! I'll leave this open for a while with the local clone repointing info... and in case anything goes wrong!

jywarren commented 4 years ago

Found and fixed many instances of master in the code itself, resolved in https://github.com/publiclab/plots2/pull/8096

jywarren commented 4 years ago

Also noting something I almost forgot - CodeClimate needs to be repointed as well, as do many 3rd party services!

Screen Shot 2020-07-07 at 2 53 13 PM