Repository: popsim-consortium/stdpopsim (language: python)

Issue:
rename master branch to main
See, e.g.
https://github.com/tskit-dev/tskit/issues/680
https://github.com/github/renaming


Discussion / hints:
yeah let's do it
I'm happy to hold off until github gives us a big easy button to push that makes most of the necessary changes. The second link above suggests that will exist by the end of the year. The other things we'll need to do is are: (1) update references to master in the docs, and (2) advertise the change to users and provide instructions for how users should update their local repositories.
It might be good to do the master->main rename soonish while the PR queue is quiet. It seems like github hasn't/can't automate this any more than they've already done. 
SGTM. Are you happy to take the reigns on this one, or would you like me to do it?
I don't think there's too much to be done, so I'm happy to do it.

Fix patch:
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 0ba36ff73..63301b36a 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -3,7 +3,7 @@ name: Build and deploy docs
 on:
   pull_request:
   push:
-    branches: [master]
+    branches: [main]
     tags:
       - '*'
 
diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml
index dbbe8bc54..b6bf67b1a 100644
--- a/.github/workflows/pre-commit.yml
+++ b/.github/workflows/pre-commit.yml
@@ -2,9 +2,9 @@ name: pre-commit
 
 on:
   push:
-    branches: [ master ]
+    branches: [ main ]
   pull_request:
-    branches: [ master ]
+    branches: [ main ]
 
 jobs:
   pre-commit:
diff --git a/README.md b/README.md
index 83c8ce2df..b43bd7544 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,12 @@
 # stdpopsim
 
-[![Docs](https://readthedocs.org/projects/stdpopsim/badge/?version=latest&style=flat)](https://stdpopsim.readthedocs.io/en/latest/)[![CircleCI](https://circleci.com/gh/popsim-consortium/stdpopsim.svg?style=svg)](https://circleci.com/gh/popsim-consortium/stdpopsim)[![codecov](https://codecov.io/gh/popsim-consortium/stdpopsim/branch/master/graph/badge.svg)](https://codecov.io/gh/popsim-consortium/stdpopsim)[![Appveyor](https://ci.appveyor.com/api/projects/status/4ugxq19ql80gcpio?svg=true)](https://ci.appveyor.com/project/popsim-consortium/stdpopsim)[![TravisCI](https://travis-ci.org/popsim-consortium/stdpopsim.svg?branch=master)](https://travis-ci.org/popsim-consortium/stdpopsim)
+[![Docs](https://readthedocs.org/projects/stdpopsim/badge/?version=latest&style=flat)](https://stdpopsim.readthedocs.io/en/latest/)[![CircleCI](https://circleci.com/gh/popsim-consortium/stdpopsim.svg?style=svg)](https://circleci.com/gh/popsim-consortium/stdpopsim)[![codecov](https://codecov.io/gh/popsim-consortium/stdpopsim/branch/main/graph/badge.svg)](https://codecov.io/gh/popsim-consortium/stdpopsim)[![Appveyor](https://ci.appveyor.com/api/projects/status/4ugxq19ql80gcpio?svg=true)](https://ci.appveyor.com/project/popsim-consortium/stdpopsim)[![TravisCI](https://travis-ci.org/popsim-consortium/stdpopsim.svg?branch=main)](https://travis-ci.org/popsim-consortium/stdpopsim)
 
 
 A community-maintained library of standard population genetic simulation models.
 Please see the [documentation](https://stdpopsim.readthedocs.io/en/latest/) for further details.
 
-Click [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/popsim-consortium/stdpopsim/master?filepath=stdpopsim_example.ipynb) to start an interactive Jupyter Notebook and start playing with `stdpopsim` now!
+Click [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/popsim-consortium/stdpopsim/main?filepath=stdpopsim_example.ipynb) to start an interactive Jupyter Notebook and start playing with `stdpopsim` now!
 
 If you use ``stdpopsim`` in your work, please cite our
 [paper](https://elifesciences.org/articles/54967).
diff --git a/README.rst b/README.rst
index 84e207212..fe70da15c 100644
--- a/README.rst
+++ b/README.rst
@@ -11,7 +11,7 @@ Stdpopsim is highly portable, and provides a number of
 To start an interactive Jupyter Notebook and start playing with ``stdpopsim`` now click
 
 .. image:: https://mybinder.org/badge_logo.svg
- :target: https://mybinder.org/v2/gh/popsim-consortium/stdpopsim/master?filepath=stdpopsim_example.ipynb
+ :target: https://mybinder.org/v2/gh/popsim-consortium/stdpopsim/main?filepath=stdpopsim_example.ipynb
 
 
 If you use ``stdpopsim`` in your work, please cite our
diff --git a/docs/conf.py b/docs/conf.py
index 1182f3917..b7075da7e 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -62,8 +62,8 @@
 # source_suffix = ['.rst', '.md']
 source_suffix = ".rst"
 
-# The master toctree document.
-master_doc = "index"
+# The entry point to the toctree document.
+index_doc = "index"
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
@@ -138,7 +138,7 @@
 #  author, documentclass [howto, manual, or own class]).
 latex_documents = [
     (
-        master_doc,
+        index_doc,
         "stdpopsim.tex",
         "stdpopsim Documentation",
         "PopSim Consortium",
@@ -151,7 +151,7 @@
 
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
-man_pages = [(master_doc, "stdpopsim", "stdpopsim Documentation", [author], 1)]
+man_pages = [(index_doc, "stdpopsim", "stdpopsim Documentation", [author], 1)]
 
 
 # -- Options for Texinfo output ----------------------------------------------
@@ -161,7 +161,7 @@
 #  dir menu entry, description, category)
 texinfo_documents = [
     (
-        master_doc,
+        index_doc,
         "stdpopsim",
         "stdpopsim Documentation",
         author,
diff --git a/docs/development.rst b/docs/development.rst
index 839e3d8fd..a01ca9ba2 100644
--- a/docs/development.rst
+++ b/docs/development.rst
@@ -51,7 +51,7 @@ help+wanted%22>`_
 To get started helping with ``stdpopsim`` development, please read the
 following sections to learn how to contribute.
 And, importantly, please have a look at our
-`code of conduct <https://github.com/popsim-consortium/stdpopsim/blob/master/CODE_OF_CONDUCT.md>`_.
+`code of conduct <https://github.com/popsim-consortium/stdpopsim/blob/main/CODE_OF_CONDUCT.md>`_.
 
 .. _sec_development_installation:
 
@@ -135,7 +135,7 @@ GitHub workflow
        is to follow this recipe::
 
         $ git fetch upstream
-        $ git checkout upstream/master
+        $ git checkout upstream/main
         $ git checkout -b topic_branch_name
 
     4. As you work on your topic branch you can add commits to it. Once you're
@@ -172,14 +172,14 @@ Rebasing
 
 Rebasing is used for two basic tasks we might ask for during review:
 
-1. Your topic branch has gotten out of date with the tip of ``upstream/master``
+1. Your topic branch has gotten out of date with the tip of ``upstream/main``
    and needs to be updated.
 2. Your topic branch has lots of messy commits, which need to be cleaned up
    by "squashing".
 
 `Rebasing <https://help.github.com/articles/about-git-rebase/>`_ in git
 basically means changing where your branch forked off the main code
-in ``upstream/master``. A good way of visualising what's happening is to
+in ``upstream/main``. A good way of visualising what's happening is to
 look at the `Network <https://github.com/popgensims/stdpopsim/network>`_ view on
 GitHub. This shows you all the forks and branches that GitHub knows about
 and how they relate to the main repository. Rebasing lets you change where
@@ -240,7 +240,7 @@ so that we remove some noise from the git history. For example, this PR
     * ad4c807 Please work, CI!
     * 0fe6dc4 Please work, CI!
     * 520e6ac Add documentation for rebasing.
-    *   20fb835 (upstream/master) Merge pull request #22 from mcveanlab/port-tennyson
+    *   20fb835 (upstream/main) Merge pull request #22 from mcveanlab/port-tennyson
     |\
     | * b3d45ea (origin/port-tennyson, port-tennyson) Quickly port Tennesen et al model.
     |/
@@ -255,11 +255,11 @@ using rebase:
 .. code-block:: none
 
     $ git fetch upstream
-    $ git rebase -i upstream/master
+    $ git rebase -i upstream/main
 
 We first make sure that we're rebasing against the most recent version of the
 upstream repo. Then, we ask git to perform an interactive rebase against
-the ``upstream/master`` branch. This starts up your editor, showing something
+the ``upstream/main`` branch. This starts up your editor, showing something
 like this::
 
     pick 520e6ac Add documentation for rebasing.
@@ -432,14 +432,14 @@ Success! We can check the history again to see if everything looks OK:
     $  git log --decorate --oneline --graph
 
     * d033ffa (HEAD -> topic_branch_name, origin/topic_branch_name) Add documentation for rebasing.
-    *   20fb835 (upstream/master) Merge pull request #22 from mcveanlab/port-tennyson
+    *   20fb835 (upstream/main) Merge pull request #22 from mcveanlab/port-tennyson
     |\
     | * b3d45ea (origin/port-tennyson, port-tennyson) Quickly port Tennesen et al model.
     |/
     *   79d26b4 Merge pull request #20 from andrewkern/fly_model
     |
 
-This looks just right: we have one commit, pointing to the head of ``upstream/master``
+This looks just right: we have one commit, pointing to the head of ``upstream/main``
 and have successfully squashed and rebased.
 
 ------------------------
@@ -450,14 +450,14 @@ Sometimes rebasing goes wrong, and you end up in a frustrating loop of making an
 undoing the same changes over and over again. In this case, it can be simplest to
 make a diff of your current changes, and apply these in a single commit. First
 we take the diff between the current state of the files in our branch and
-``upstream/master`` and save it as a patch::
+``upstream/main`` and save it as a patch::
 
-    $ git diff upstream/master > changes.patch
+    $ git diff upstream/main > changes.patch
 
 After that, we can check out a fresh branch and check if everything works
 as it's supposed to::
 
-    $ git checkout -b test_branch upstream/master
+    $ git checkout -b test_branch upstream/main
     $ patch -p1 < changes.patch
     $ git commit -a
     # check things work
@@ -751,7 +751,7 @@ When developers A and B disagree on the model implementation, the process is to:
 
     3. If changes have to be made to the production model Developer A submits a
        PR with the hotfix for the production model. Developer B then rebases
-       the branch containing their PR against master to check for model
+       the branch containing their PR against the main branch to check for model
        equality. Repeat steps 1-3 until this is achieved. If changes have to be
        made to the QC model they are committed to the branch where the QC PR
        originates from.
diff --git a/docs/index.rst b/docs/index.rst
index cc9e3cce6..a3332d06d 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,4 +1,4 @@
-.. stdpopsim documentation master file, created by
+.. stdpopsim documentation index file, created by
    sphinx-quickstart on Sun Feb  3 17:26:38 2019.
    You can adapt this file completely to your liking, but it should at least
    contain the root `toctree` directive.
diff --git a/docs/installation.rst b/docs/installation.rst
index 89c468cd8..d89977334 100644
--- a/docs/installation.rst
+++ b/docs/installation.rst
@@ -5,10 +5,10 @@ Installation
 ============
 
 You can get started right away, without installing ``stdpopsim`` locally, by using the
-`Jupyter Binder <https://mybinder.org/v2/gh/popsim-consortium/stdpopsim/master?filepath=stdpopsim_example.ipynb>`_. |binder|
+`Jupyter Binder <https://mybinder.org/v2/gh/popsim-consortium/stdpopsim/main?filepath=stdpopsim_example.ipynb>`_. |binder|
 
 .. |binder| image:: https://mybinder.org/badge_logo.svg
- :target: https://mybinder.org/v2/gh/popsim-consortium/stdpopsim/master?filepath=stdpopsim_example.ipynb
+ :target: https://mybinder.org/v2/gh/popsim-consortium/stdpopsim/main?filepath=stdpopsim_example.ipynb
 
 
 There are two basic options for installing ``stdpopsim`` and its dependencies: either
diff --git a/docs/introduction.rst b/docs/introduction.rst
index c7b6e68aa..3c4b4805b 100644
--- a/docs/introduction.rst
+++ b/docs/introduction.rst
@@ -48,7 +48,7 @@ Github `issues <http://github.com/popgensims/stdpopsim/issues>`_.
 There is a lot of chatter through
 Github, and we’ve been building code
 there cooperatively. If you are interested in joining us please read our
-`code of conduct <https://github.com/popsim-consortium/stdpopsim/blob/master/CODE_OF_CONDUCT.md>`_.
+`code of conduct <https://github.com/popsim-consortium/stdpopsim/blob/main/CODE_OF_CONDUCT.md>`_.
 A particular goal of this project is to build a diverse and supportive community,
 and so we especially encourage individuals from underrepresented groups in popgen to join.
 Being a member of the Consortium can provide a valuable avenue for career development, through
diff --git a/environment.yml b/environment.yml
index 5face86c6..d6a2cc62a 100644
--- a/environment.yml
+++ b/environment.yml
@@ -18,4 +18,4 @@ dependencies:
         - matplotlib
         # load the stdpopsim Github repository as a library using pip
         - pip:
-            - "--editable=git+https://github.com/popgensims/stdpopsim.git#egg=stdpopsim-master"
+            - "--editable=git+https://github.com/popgensims/stdpopsim.git#egg=stdpopsim-main"
diff --git a/stdpopsim_example.ipynb b/stdpopsim_example.ipynb
index 35f7dc8c5..42f544194 100644
--- a/stdpopsim_example.ipynb
+++ b/stdpopsim_example.ipynb
@@ -8,7 +8,7 @@
     "\n",
     "#### This notebook serves as a place to play with `stdpopsim` in a ready to go environment.\n",
     "\n",
-    "If you did not open this notebook via Binder, try clicking [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/popsim-consortium/stdpopsim/master?filepath=stdpopsim_example.ipynb)"
+    "If you did not open this notebook via Binder, try clicking [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/popsim-consortium/stdpopsim/main?filepath=stdpopsim_example.ipynb)"
    ]
   },
   {


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 32f4c501b..2a52b51eb 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -2,9 +2,9 @@ name: tests
 
 on:
   push:
-    branches: [ master ]
+    branches: [ main ]
   pull_request:
-    branches: [ master ]
+    branches: [ main ]
 
 jobs:
   tests: