Something I was trying to do over the weekend, but couldn’t work out, was to construct a link to the latest/newest/most recent version of a file—what some other version control systems refer to as HEAD—on GitHub. I couldn’t do it, and the people I asked didn’t know how to either.

Today, I worked it out: just replace the commit hash with the branch name. It makes sense when you think about it, but my knowledge of git wasn’t deep enough to allow me to make that leap.

So, for example, this link to the raw version of a particular commit (newlines added for formatting)


Or, to put it another way:<user>/<project>/raw/<branch>/<path to file>

It’s easy when you know how, isn’t it?