Your favorite time-machine
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!
See what files are ready to be made into a “snapshot” (committed) and which ones are not being kept track of
Create a new git repository for the first time (will not add any files)
Add file(s) to the list of files that should be made into a “snapshot” (committed)
Take a “snapshot” of all currently tracked project files. Files need to be “prepped” (staged) for commit using
git add beforehand.
See the full historical timeline of the project
Send latest local changes to a remote location (e.g. github)
Get the latest changes from a remote location (e.g. github)
Duplicate a remote repository (e.g. github) on your local computer
Create a new independent “timeline” for the project
Undo changes by reversing any specific “snapshot” (commit)
Copy a remote repository on github, to your own remote account on github
Notify a remote repository owner you would like them to review+incorporate your additions