Sync an existing GitHub repository with Bioconductor

Goal: Ensure that your local, Bioconductor, and GitHub repositories are all in sync.

Steps:

  1. Clone the the GitHub repository to a local machine. Change into the directory containing the repository.

  2. Configure the “remotes” of the GitHub clone.

     git remote add upstream git@git.bioconductor.org:packages/<YOUR-REPOSITORY>.git
    
  3. Fetch updates from all (Bioconductor and GitHub) remotes. You may see “warning: no common commits”; this will be addressed after resolving conflicts, below.

     git fetch --all
    
  4. Make sure you are on the master branch.

     git checkout master
    
  5. Merge updates from the GitHub (origin) remote

     git merge origin/master
    
  6. Merge updates from the Bioconductor (upstream) remote

     git merge upstream/master
    

    Users of git version >= 2.9 will see an error message (“fatal: refusing to merge unrelated histories”) and need to use

     git merge --allow-unrelated-histories upstream/master
    
  7. Resolve merge conflicts if necessary.

  8. After resolving conflicts and commiting changes, look for duplicate commits (e.g., git log --oneline | wc returns twice as many commits as in SVN) and consider following the steps to force Bioconductor master to GitHub master.

  9. Push to both Bioconductor and GitHub repositories.

     git push upstream master
     git push origin master
    
  10. Repeat for the release branch, replacing master with the name of the release branch, e.g., RELEASE_3_6. It may be necessary to create the release branch in the local repository.

     git checkout RELEASE_3_6
     git merge upstream/RELEASE_3_6
     git merge origin/RELEASE_3_6
     git push upstream RELEASE_3_6
     git push origin RELEASE_3_6
    

    Remember that only master and the current release branch of Bioconductor repositories can be updated.