Version control

Why version control?

PhD Comics

Why version control?

  • Simple formal system for tracking all changes to a project

  • Time machine for your projects
    • Track blame and/or praise
    • Remove the fear of breaking things
  • Learning curve is a bit steep, but when you need it you REALLY need it



Your closest collaborator is you six months ago, but you don’t reply to emails.

– Paul Wilson, UW-Madison

Why git?

  • Distributed
    • Work online or offline
    • Collaborate with large groups
  • Popular and Successful
    • Active development
    • Shiny new tools and ecosystems
    • Fast
  • Tracks any type of file

  • Branching
    • Smarter merges

Git live demo

Git live demo

  • Create a repository on Github

  • Connect an R project to Github repository

  • Working with a local and remote repository

  • Staging, Committing, Pushing and Pulling

  • Merge conflicts

  • Best practices

Update your analysis

What if you wanted to now change your analysis

  • to subset for 1952

  • plot life expectancy (lifeExp) vs. population (pop)

  • and size the points by GPD (gpdPercap)
    • hint: add argument size = gpdPercap to your plotting code

Learn more