author: Cory Whitney ([email protected]) font-family: 'Helvetica' autosize: true css: mySlideTemplate.css <img src="R_Git_GitHub-figure/github.png" style="background:none; border:none; box-shadow:none;height="400"; width="400";"><img src="R_Git_GitHub-figure/INRES_Logo.png" style="background:none; border:none; box-shadow:none;height="100"; width="100";"><img src="R_Git_GitHub-figure/Uni_Bonn_Picture.png" style="background:none; border:none; box-shadow:none;height="200"; width="200";"><img src="R_Git_GitHub-figure/ZEF_Logo.png" style="background:none; border:none; box-shadow:none;height="200"; width="200";">
incremental: true
Never have I ever:
- used 'cmd z' or 'ctrl z'
- came to the office but left the work at home on another machine or USB
- tried to co-author scripts by emailing files back and forth
Git is an open source version control tool, GitHub is a company that hosts Git repositories in the web and provides a web interface to interact with repos they host.
incremental: true
right: 80%
https://git-scm.com/
A better way to:
- "undo" changes,
- collaborate than mailing files back and forth, and
- share code and other scientific work with the world.
your local repository consists of three "trees" maintained by git. the first one is your Working Directory
which holds the actual files. the second one is the Index
which acts as a staging area and finally the HEAD
which points to the last commit you've made.
- If you get stuck, just add “Git” to a search query e.g. a short description of your issue
- Someone else has also been confused by it and has written about it
- Thousands of talented programmers who scan the web and answer these problems
Install Git & join Github (if you have not already):
-
install Git https://git-scm.com/downloads
-
join Github https://github.com/
Some useful tips on getting these running from our friends
-
University of Zurich http://www.geo.uzh.ch/microsite/reproducible_research/post/rr-rstudio-git/
-
Nathan Stephens, a very helpful R blogger https://support.rstudio.com/hc/en-us/articles/200532077-Version-Control-with-Git-and-SVN
GitHub
- a commercial website that lets you store repository publicly for free get an education account with an uni email address
- a friendly interface, no need to remember command line.
- useful features including issues, wikis etc.
incremental: true
https://guides.github.com/activities/hello-world/
incremental: true
right: 80%
https://git-scm.com/
-
git reset --soft HEAD~1
orcommit SHA
we undo our last commit, but the changes contained in that commit are not lost -
git reset --hard HEAD~1
orcommit SHA
we discard all changes we've made in the working directory -
git stash
move the waiting changes out of the queue