Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
28 tasks done
jywarren opened this issue Jun 24, 2020 · 4 comments
Closed
28 tasks done

Comments

@jywarren
Copy link
Member

jywarren commented Jun 24, 2020

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
Copy link
Member Author

Great! Done - now just repointing PRs!

@jywarren
Copy link
Member Author

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
Copy link
Member Author

Found and fixed many instances of master in the code itself, resolved in #8096

@jywarren
Copy link
Member Author

jywarren commented Jul 7, 2020

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

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants