Exercise submissions with Git and Github

Nils Ratnaweera

Nils Ratnaweera

ZHAW School of Life Sciences and Facility Management
Institute of Natural Resource Sciences
Grüentalstrasse 14
8820 Wädenswil

+41 (0) 58 934 55 63
rata@zhaw.ch

What?

In this course you will submit R-related materials:

  • two R-exercises (exercise 2 and 3)
  • one semester project


In this course you will submit R-related materials:

  • two R-exercises (exercise 2 and 3)
  • one semester project


You will use git with Github for these submissions!

Why git?

  • Safety and Control
  • Collaboration
  • Community

Safety and Control

Final.doc Final_rev.2.doc FINAL_rev.6.COMMENTS.doc FINAL_rev.8.comments6.CORRECTIONS.doc FINAL_rev.18.comments7.corrections9.MORE.30.doc FINAL_rev.22.comments49.corrections.10.#@$%WHYDIDICOMETOGRADSCHOOL????.doc
commit c84ef9 commit 12e6d8 commit be60d0 commit 597dfe commit f79a85 commit cf9253 Who made the commit? When was the commit made? What changed precisely? (Why was the commit made?)

What about Dropbox, Googledrive et al.?

These type of software are not designed for code since files are tracked:

  • individually
  • continuously
  • uncommented

These type of software are not designed for code since files are tracked:

  • individually individually and on a project basis
  • continuously
  • uncommented

These type of software are not designed for code since files are tracked:

  • individually individually and on a project basis
  • continuously with "snapshots"
  • uncommented

These type of software are not designed for code since files are tracked:

  • individually individually and on a project basis
  • continuously with "snapshots"
  • uncommented with comments
Git is your safety rope, so that you don't fall (too far)

Collaboration

  • Git makes collaboration smoother
  • Git repositories can easily be synced with Git servers (e.g. GitHub, Bitbucket or Gitlab)
  • Track changes works online as well as offline
  • Conflicts are rare 1 and very specific 2

Community

We will use Github for this course, which will give you access to a great community!
In addition to hosting Git repos, Github is a social media platform for geeks. You can:
  • like repos
  • follow developers
  • ask questions
  • make suggestions
  • build your own portfolio on Github

A few caveats

A few caveats

  • Learning Git can cause some initial pain
  • New workflow / new habits when coding
  • new terminology (stage, commit, push, pull...)
  • Installation / preperation
    • Install the Git-software
    • Setup RStudio to work with Git
    • Create a Github account (next week)
Todays goals:

  • Initialize an RStudio Project with Git Version control
  • Commit your work progress to your local repository