Finalize and push package to GitHub

All what is mentioned below can be done via command line. However this guide is meant for developers working from both Linux and Windows and the latter may not be able to easily use the command line route. Hence most of this is demonstrate using the Rstudio graphical interface except where I had trouble using that interface due to problem with the version I had.

About finalizing and submitting packages to github

Follow this guide whenever you build a package or amend a function(s) in a package. So it is not just for packages built from scratch.

Build the package, generate/update the help files and run checks

In your Rstudio and if the package you were working on is not already loaded go to File and under that tab select Open Project; navigate to the location of your project and load it.
Make sure you are correctly set up to build a package and generate help files from your functions headers. See this page on how to get the right settings. Follow the below points and in this order:

  • On the top right of your Rstudio select the tab Build and click on Build a& Reload to build your package.

  • On the top right of your Rstudio select the tab Build, click on More and then on Reoxygenise on the selection you are presented with.

  • On the top right of your Rstudio select the tab Build and click on Check (see figure under the first bullet point). This step will check your package for syntax error and missing elements.

Commit your changes

This will 'save' your work locally. On the top right of your Rstudio select the tab Git, tick the boxes next to all the items you want to commit (here we commit everything) and click on Commit.

After hitting Commit you will be presented with the below window. Write a message to explain your commit; try to keep it short but make sure it is meaningful.

Push your changes to your branch in GitHub

Now you can 'transfer' your work to your branch in the DataSHIELD GitHub project.
open a terminal and run the command that pushes the changes to your branch (if you have an Rstudio version where the Push Branch option works you can use that).

Quick check before pushing to GitHub

Before running the 'push' command you might want to run the two below commands on the terminal to respectively check which branch you are in (the active branch will have an asterix symbol next to it) and check the status of your repository/project.

git branch
git status

DataSHIELD Wiki by DataSHIELD is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Based on a work at http://www.datashield.ac.uk/wiki