Goal: During everyday development, you commit changes to your local repository master
branch, and wish to push these commits to both GitHub and Bioconductor repositories.
NOTE: See Scenario 3 for best practices for pulling updates from Bioconductor and GitHub before committing local changes.
-
We assume you already have a GitHub repository with the right setup to push to Bioconductor's git server (git@git.bioconductor.org). If not please see FAQ's on how to get access and follow Scenario 1. We use a clone of the
BiocGenerics
package in the following example. -
To check that remotes are set up properly, run the command inside your local machine's clone.
git remote -v
which should produce the result (where is your GitHub username):
origin git@github.com:<developer>/BiocGenerics.git (fetch) origin git@github.com:<developer>/BiocGenerics.git (push) upstream git@git.bioconductor.org:packages/BiocGenerics.git (fetch) upstream git@git.bioconductor.org:packages/BiocGenerics.git (push)
-
Make and commit changes to the
master
branchgit checkout master ## edit files, etc. git add <name of file changed> git commit -m "My informative commit message describing the change"
-
(Alternatve) When changes are more elaborate, best practice is to use a local branch for development.
git checkout master git checkout -b feature-my-feature ## multiple rounds of edit, add, commit
Merge the local branch to master when the feature is 'complete'.
git checkout master git merge feature-my-feature
-
Push updates to GitHub's (
origin
)master
branchgit push origin master
-
Next, push updates to Bioconductor's (
upstream
)master
branchgit push upstream master
-
Confirm changes, e.g., by visiting the GitHub web page for the repository.