Update: As of 11 January 2022, git.io no longer accepts new URLs.
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 .git (only the repository name) or ? at the end in your GitHub URL.
curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL.git" -F "code=YOUR_CUSTOM_NAME"
curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL?" -F "code=YOUR_CUSTOM_NAME"Shortcut to this Gist: git.io/customurl
Those Who all are trying to shorten their
USERNAME.github.io/REPOlink, If y'all face any errors,Then don't do the
.githack suggested by @koumaza here.Change your repo name a bit, and then try the same thing.