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.
Create a new GitHub account if you don’t have one.
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.
Once you have submitted your keys, you can login to the BiocCredentials application to check if the correct keys are on file with Bioconductor.
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.
On your local machine, clone the empty repository from GitHub.
Use https
URL (replace <developer>
with your GitHub username)
git clone https://github.com/<developer>/BiocGenerics.git
or SSH
URL
git clone git@github.com:<developer>/BiocGenerics.git
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 git@git.bioconductor.org:packages/BiocGenerics.git
Fetch content from remote upstream,
git fetch upstream
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.
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
.
(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
Check your GitHub repository to confirm that the master
(and
optionally RELEASE_3_6
) branches are present.
Once the GitHub repository is established follow Push to GitHub and Bioconductor to maintain your repository on both GitHub and Bioconductor.