Command:
curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"
URLs that can be created is from:
https://github.com/*
https://*.github.com
https://*.github.com/*
https://*.github.io
https://*.github.io/*
https://*.githubusercontent.com/*
If you accidentally make a typo in the custom name, you can add ?
at the end in your GitHub URL.
curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL?" -F "code=YOUR_CUSTOM_NAME"
If you want to revoke your custom name, you should contact GitHub Support Team.
Note that once you've created a URL it is essentially "stuck", so you don't want to create
git.io/mycustomname
with a URL tied to a specific commit, because any future commits won't be reflected when users access your URL. You'll want to use a floating reference likemaster
or similar and if using a/raw/
URL make sure you use a version not tied to a specific commit, in the case of a Gist you can do this by dropping the commit ID between the/raw/
and the filename in the Gist you want users to be able to access easily.Eg, the RAW for this gist at the time of this comment is
https://gist.github.com/espoelstra/3ee4584f157ab9be5a1310253923b3ac/raw/087af548553863a44c855f6d62402812148449e8/git-io-custom-url.md
but if I drop the087af548553863a44c855f6d62402812148449e8
and make agit.io
URL then as I make changes to the Gist even if I force pushed to replace all the history, as long as the Gist's ID didn't change this URL,https://gist.github.com/espoelstra/3ee4584f157ab9be5a1310253923b3ac/raw/git-io-custom-url.md
should always point to the specific markdown file.