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.comhttps://*.github.com/*https://*.github.iohttps://*.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/mycustomnamewith 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 likemasteror 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.mdbut if I drop the087af548553863a44c855f6d62402812148449e8and make agit.ioURL 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.mdshould always point to the specific markdown file.