Your favorite time-machine
Table of Contents
This is a long overdue post regarding one of the tutorials I taught at the 2018 Dartmouth Methods in Neuroscience (MIND) summer school on version control for researchers. Rather than recount my 30 minute talk and demo here, I figured I would share direct links to the materials so interested folks could peruse them at their leisure.
In this talk, and for myself, I’ve found the analogy of a version control system (e.g. git) as a (social) time-machine incredibly useful for understanding fundamental concepts. In case this framing is useful for others, my talk can be seen in it’s entirety at the bottom of this post; the slides accompanying the talk can be found here.
Something summer school attendees told me they found really useful were some animated gifs I generated capturing the output of the most commonly used git commands, as well as actions on github.com, to see what to expect and how they work. I’ve embedded those below as a reference as well. Enjoy!
git status
See what files are ready to be made into a “snapshot” (committed) and which ones are not being kept track of
git init
Create a new git repository for the first time (will not add any files)
git add
Add file(s) to the list of files that should be made into a “snapshot” (committed)
git commit
Take a “snapshot” of all currently tracked project files. Files need to be “prepped” (staged) for commit using git add
beforehand.
git log
See the full historical timeline of the project
git push
Send latest local changes to a remote location (e.g. github)
git pull
Get the latest changes from a remote location (e.g. github)
git clone
Duplicate a remote repository (e.g. github) on your local computer
git branch
Create a new independent “timeline” for the project
git revert
Undo changes by reversing any specific “snapshot” (commit)
forking
Copy a remote repository on github, to your own remote account on github
pull request
Notify a remote repository owner you would like them to review+incorporate your additions