Org Mode Links to Git Commits

One of the nice things about writing with the Org-mode mark-up language is the ability to easily add links to external sources such as HTTP links or mail messages. But what about linking to a Git commit? Happily, there’s a Worg article that describes org-git-link.el, a contributed package shipped with Org-mode, that allows you to do just that.

A reasonable question is why anyone would want to do that. The article has an interesting use case. Suppose you are using Org to implement a laboratory notebook and that you have a link to an externally generated graph of some data. You add some notes about some aspect or another of the graph but later update the graph with new data. Now the link points to the new graph and the explanatory note is out of date. To prevent that, you commit the first graph and then link to the commit. Now if the graph is updated, the link still points to the original graph and the notes are still accurate.

The article covers how to form the links and the various formats they can take. It’s easy to imagine additional use cases for this facility so it’s well worth being familiar with it.

This entry was posted in General and tagged , . Bookmark the permalink.