Skip to content

Instantly share code, notes, and snippets.

@tongpu
Created October 16, 2019 07:57
Show Gist options
  • Save tongpu/0be1ee2a57b0ae7c1cf38df56e6b9c72 to your computer and use it in GitHub Desktop.
Save tongpu/0be1ee2a57b0ae7c1cf38df56e6b9c72 to your computer and use it in GitHub Desktop.
A simple shell function to replace /blob/ with /raw/ in a GitHub URL to download the raw file
function github-raw() {
# replace /blob/ in the GitHub URL with /raw/
curl --silent --location --remote-name ${1:s#/blob/#/raw/#}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment