Create a new GitHub repository for an existing Bioconductor package

Goal: As a maintainer, you’d like to create a new GitHub repository for your existing Bioconductor repository, so that your user community can engage in the development of your package.


  1. Create a new GitHub account if you don’t have one.

  2. Set up remote access to GitHub via SSH or Https. Please check which-remote-url-should-i-use and add your public key to your GitHub account.

  3. If you have an existing svn account, submit your SSH public key or github id to Bioconductor.

  4. Create a new GitHub repository on your account, with the name of the existing Bioconductor package.

    We use “BiocGenerics” as an example for this scenario.

    After pressing the ‘Create repository’ button, ignore the instructions that GitHub provides, and follow the rest of this document.

  5. On your local machine, clone the empty repository from GitHub.

    Use https URL (replace <developer> with your GitHub username)

    git clone<developer>/BiocGenerics.git

    or SSH URL

    git clone<developer>/BiocGenerics.git
  6. Add a remote to your cloned repository.

    Change the current working directory to your local repository cloned in the previous step.

    cd BiocGenerics
    git remote add upstream
  7. Fetch content from remote upstream,

    git fetch upstream
  8. Merge upstream with origin’s master branch,

    git merge upstream/master

    NOTE: If you have the error fatal: refusing to merge unrelated histories, then the repository cloned in step 4 was not empty. Either clone an empty repository, or see Sync existing repositories.

  9. Push changes to your origin master,

     git push origin master

    NOTE: Run the command git config --global push.default matching to always push local branches to the remote branch of the same name, allowing use of git push origin rather than git push origin master.

  10. (Optional) Add a branch to GitHub,

    ## Fetch all updates
    git fetch upstream
    ## Checkout new branch RELEASE_3_6, from upstream/RELEASE_3_6
    git checkout -b RELEASE_3_6 upstream/RELEASE_3_6
    ## Push updates to remote origin's new branch RELEASE_3_6
    git push -u origin RELEASE_3_6
  11. Check your GitHub repository to confirm that the master (and optionally RELEASE_3_6) branches are present.

  12. Once the GitHub repository is established follow Push to GitHub and Bioconductor to maintain your repository on both GitHub and Bioconductor.