Toolchain Tuesday No. 4
TL;DR: Part of a series of posts about tools, services, and packages that I use in day-to-day operations to boost efficiency and free up time for the things that really matter. Use at your own risk - happy to answer questions. For the full, continuously expanding list so far see here.
This is the fourth installment of a series of posts; the full list is expanding over time. This time around will be about git
, which enables version control and distributed, asynchronous collaboration. Git
is probably the single most useful tool in my workflow.
Software
git
Decentralized version control for coding, latex documents, and much more.
Learning curve: ⭐️⭐️⭐️⭐️
Usefulness: ⭐️⭐️⭐️⭐️⭐️
Site: https://github.com/git/git
Git
is the single most useful tool in my whole workflow. Think of it as the operating system that underlies almost everything. Basically everything from writing papers, coding, all my markdown documents, and even my Jekyll
-driven sites are managed in a git
repository. So what is git
? From [wikipedia]:
Git (/ɡɪt/) is a version-control system for tracking changes in computer files and coordinating work on those files among multiple people. It is primarily used for source-code management in software development, but it can be used to keep track of changes in any set of files. As a distributed revision-control system, it is aimed at speed, data integrity, and support for distributed, non-linear workflows. […] As with most other distributed version-control systems, and unlike most client–server systems, every Git directory on every computer is a full-fledged repository with complete history and full version-tracking abilities, independent of network access or a central server.
So what do these features come down to in the hard reality of day-to-day life?
-
Collaboration. Working with others without having to worry about ‘tokens’ and other concepts solely created to implement file locks through human behavior.
Git
provides capabilities for distributed and asynchronous collaboration. In terms of how awesomegit
really is, let the numbers speak: Microsoft just paid $7.5 billion forgithub
, one of the maingit
repository platforms, for a reason… Withgit
any number of people can work on the same files, code, project etc andgit
will automatically merge changes provided they were not overlapping and if they were overlapping they can be merged relatively easily by hand with the help ofgit
. Also, nothing is ever lost! Remember, when you shared files on Dropbox and someone overwrote your file after you edited it painstakingly just to fix a comma? Withgit
this cannot happen. -
Backup and full history. Every copy of the repository on any machine contains the full version history. This provides incredible redundancy and if you
push
into a remote repository then you have a remote backup that you canpull
from basically any location with an internet connection. For repository space check out, e.g., bitbucket.org and github.com. -
Different version branches. Another powerful feature of
git
is to maintain and synchronize different versions of a product throughbranches
. One of the most common use cases for me is for example, when we have an arxiv version and a conference version of a paper, which need to be keep synchronized. Withgit
you can easily track changes between these versions andcherry pick
those that you want to synchronize.
Unfortunately, the learning curve of git
is quite steep, in particular if you want to do something slightly more advanced. For most users I highly recommend a git
gui as it makes merging etc much easier. I will mention two choices below. There are tons of git tutorials online and a good starting point is [here] and [here]. (Ping me for your favorite one; happy to add links)
Sourcetree
Great and free git
gui for mac os x and windows.
Learning curve: ⭐️⭐️
Usefulness: ⭐️⭐️⭐️⭐️
Site: https://www.sourcetreeapp.com/
Sourcetree
is a great graphical git
client. It has full support for git
and comes with many useful features and is free. Not much to say otherwise: the power of gui
accessible through a great user interface.
SmartGit
Great git
gui for mac os x and windows.
Learning curve: ⭐️⭐️
Usefulness: ⭐️⭐️⭐️⭐️
Site: https://www.syntevo.com/smartgit/
SmartGit
is another great graphical git
client and it is free for non-commercial use. Otherwise the same as for Sourcetree
applies here; both Sourcetree
and SmartGit
are great and it comes down to personal preference.