Confessions of a researchaholic

August 26, 2018

Git research source

Filed under: Real — liyiwei @ 3:53 pm
Tags: ,

Below is a summary of my suggestions of using git to manage research source, based on numerous discussions I have had with my collaborators across multiple projects at multiple institutions.

Always revision control your code. There are multiple options, but at this moment of writing, git beats alternatives such as svn and perforce.

Use github for public repos and bitbucket for private repos.

Start with existing code if feasible. If the code is already under git, use submodule as a component or fork/branch as an extension. Otherwise, convert the code into git, and preserve revision history whenever possible (e.g. github/bitbucket can help you convert svn repos into git repos).

Use multiple branches for different versions of the code, such as stable branch for release or a personal branch for experiments.
Use multiple remotes across organizations and time-frames.
For example, during your internship with a company, use an internal corporate github repo, and sync it with an external bitbucket (private) repo at the end of your internship so that you can continue the project at your school. When you are ready to publish your code, mirror it to a public github repo.
Keep multiple remotes under the same repo for easy management.

For paper drafts, you can create an overleaf git branch for more WYSIWYG-style editing while retaining all the benefits of branching and revision control.

Keep one (or at most a few) sentence(s) at one line, to avoid false alarms from spell checkers (broken sentences) and excessive (line-based) diff by git.
Note that Latex treats line breaks as spaces.

Chongyang Ma (@ Snap Research) has recommendations for industry research code practice.

3 Comments »

  1. I have been thinking about reviving my blog by writing an article on the same topic for a while! Fortunately I have some different comments but I will certainly cite this blog.

    Comment by Chongyang Ma — August 26, 2018 @ 9:51 pm | Reply

    • If you like, we can co-author a medium post about this, in particular about the parts we have different opinions which can be very fun.

      Comment by liyiwei — August 27, 2018 @ 10:11 am | Reply

  2. […] de facto PhD supervisor, Dr. Li-Yi Wei, has also written a blog post on the same topic with many useful […]

    Pingback by Industry Coding Practices for Research Projects | Chongyang Ma's Blog — August 27, 2018 @ 8:23 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Theme: Rubric. Get a free blog at WordPress.com