# README This repository is for code to be shared between the Uncertainty Quantification (UQ) group at the University of Exeter. Please make every effort to follow best practice whilst coding and testing your functions. If you are new to git you could familiarize yourself with [this guide](https://wildlyinaccurate.com/a-hackers-guide-to-git/) from "Widly Inaccurate" and [this tutorial](https://www.atlassian.com/git/tutorials/learn-git-with-bitbucket-cloud) from Atlassian. There is also the freely available [Pro Git book](https://git-scm.com/book), which is considered the bible of git. To learn how to use Git with RStudio follow [this link](https://jennybc.github.io/2014-05-12-ubc/ubc-r/session03_git.html). If you create a new directory please include a `ReadMe.md` file as a minimum. In order to link up to the repository you can use one of two different ways, either using **Terminal** or **RStudio**. ### Terminal **(The following instructions are provided by ExeClim)** First clone the code from the remote repository, make a local development branch `example_dev_branch`, tell the remote repository that there is a new branch and then check it out. ``` git clone git@git.exeter.ac.uk:dw356/ExeterUQ.git git branch example_dev_branch git push -u origin example_dev_branch git checkout example_dev_branch ``` If changes have been made to `local` master (local is your machine) and you want to do a merge of the `local` master on your `example_dev_branch` branch: ``` git checkout example_dev_branch git merge master ``` If changes have been made to the `remote` master and you want to do a merge of the `remote` master onto your `example_dev_branch` branch: ``` git checkout master git pull origin master git checkout example_dev_branch git merge master ``` ### RStudio Since you have an existing remote Git repository that you want to use as the basis for an RStudio project you should (if you need extra help please follow [this guide](https://support.rstudio.com/hc/en-us/articles/200532077-Version-Control-with-Git-and-SVN)): 1. Execute the **New Project** command (from the Project menu) 2. Choose to create a new project from **Version Control** 3. Choose **Git** 4. Provide the repository URL (and other appropriate options) and then click **Create Project**. ### Start working with the remote repository To start operating with the remote repository, create a local development branch ``example_dev_branch`` from RStudio by opening **Shell...** ``` git branch example_dev_branch git push -u origin example_dev_branch git checkout example_dev_branch ``` To merge the code from ``master`` branch to your ``example_dev_branch`` on your local machine and update your remote ``example_dev_branch`` (what you see on GitHub) ``` git checkout example_dev_branch git merge master git push ```