+ - 0:00:00
Notes for current slide
Notes for next slide

Collaboration, version control & learning to commit

R-thritis Group

David Selby

12th March 2021

1 / 13

 

Final version

2 / 13

3 / 13

Motivation — why git & GitHub?

"Version control is the only reasonable way to keep track of changes in code, manuscripts, presentations, and data analysis projects...

"GitHub lowers the barriers to collaboration."

Karl Broman

4 / 13

Local version control

  • Keep many local copies of files in a folder
    • e.g. RCS, Windows File History

Centralised version control

  • Check out snapshots of files from single server
    • e.g. CVS, Office 365, Dropbox, Isilon

Distributed version control

  • Mirror the entire repository, including full history
    • e.g. Git, Mercurial
5 / 13

Local vs. centralised VCS

Local VCS

Centralised VCS

 

Source: Pro Git (2014)

6 / 13

Centralised vs. distributed VCS

Centralised VCS

Distributed VCS

Source: Pro Git (2014)

7 / 13

Git and GitHub

Git ≠ GitHub (just as R ≠ RStudio).
GitHub is a hosting provider for your files, via Git software.

Others are available:

GitHub provides extra features on top of Git:

8 / 13

Git command line operations

  • git init / clone
    • start a new repository (or copy an existing one)
  • git add / rm
    • add/remove a file to version control
  • git diff / status
    • see what's changed
  • git commit
    • save changes to history
  • git branch / merge
    • start new branch / merge one into another
  • git push
    • upload changes to the remote repository
  • git pull
    • download changes from remote repository
9 / 13

GitHub operations

  1. Create or fork a repository
  2. Add files
  3. Commit changes
  4. Compare diff versions
  5. Make and accept pull requests.

RStudio operations

  1. Init/Clone a repository as an RStudio Project
  2. Pull changes from remote
  3. Add files locally
  4. Commit changes
  5. Push to remote
10 / 13

Demonstration

11 / 13

Further reading

  1. Practical Worksheet

  2. Version control for scientific research (Hrynaszkiewicz, 2013)

  3. Version control with RStudio (Stephens, 2021)

  4. Happy Git and GitHub for the useR (Bryan et al., 2016)

  5. Minimal git/github tutorial guide (Broman, 2013)

12 / 13

Next Rthritis meeting

Statistical modelling with Stan

Friday 26th March @ 11:00
Belay Birlie Yimer

Contact david.selby@manchester.ac.uk to suggest topics/speakers

13 / 13

 

Final version

2 / 13
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow