Git for cognitive scientists
For our lab meeting this week, I presented a tutorial on how cognitive scientists can take advantage of Git, a version control system. Git is a system which helps you keep track of all the iterations your project goes through.
While the benefits of Git are obvious in terms of backing up and sharing with others through services such as Github, the branching and tagging model used by Git can be uniquely suited to the sorts of organizational issues cognitive scientists often have to grapple with.
First, scientists need an easy way to archive code that has actually been run on human subject. Rather than making multiple copies of the code filling up you hard drive, this is facilitated by Git’s “tagging” feature (described more in the slides below).
Second, cognitive scientists often need to track multiple versions of the same codebase, as when multiple experiments in a paper implement the same task with different manipulations. Git’s branching feature (also described below) makes it easy to fix a bug in the experiment once, and then painlessly apply that bugfix to each version of the experiment.
A final feature of Git is the opportunities for collaboration. Git allows multiple people to be working on a project at the same time and can help merge those changes later. You can think of it as similar to Word’s “track changes” feature but it applies to any type of file, for example software code or papers written in LaTeX.
If this sounds interesting to you, you might want to take a look at my slides, which I’ve annotated and adapted into a web page, available here. Git has a slight learning curve if you are unfamiliar with version control software like subversion. However, I have provided specific commands that should hopefully make it easy for you to follow along. With a little disciplined use of Git it can make your scientific projects more organized, bug free, and shareable!
Our lab is already making extensive use of Git and Github. In fact, you can take a look at our public repositories here.