Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
git.io custom URL

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 .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"

If you want to revoke your custom name, you should contact GitHub Support Team. As of 23 September 2020, you can no longer request to revoke your outdated or incorrect git.io URL.

Shortcut to this Gist: git.io/customurl

@alekssamos

This comment has been minimized.

Copy link

@alekssamos alekssamos commented Aug 14, 2019


Connecting to git.io[54.152.127.232]:443... connected.

Unable to establish SSL connection.

Unable to establish SSL connection.
@FranklinYu

This comment has been minimized.

Copy link

@FranklinYu FranklinYu commented Aug 25, 2019

Note that a long link can only be mapped to one short link.

@koumaza

This comment has been minimized.

Copy link

@koumaza koumaza commented Jun 8, 2020

There is also such a method.
Add .git after the URI.

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL.git" -F "code=YOUR_CUSTOM_NAME"
@dikiaap

This comment has been minimized.

Copy link
Owner Author

@dikiaap dikiaap commented Jun 9, 2020

@koumaza Good catch! I have updated the Gist.

@steinbrueckri

This comment has been minimized.

Copy link

@steinbrueckri steinbrueckri commented Jun 12, 2020

❤️

@yamiacat

This comment has been minimized.

Copy link

@yamiacat yamiacat commented Sep 25, 2020

Please note that as of Sep 2020 GitHub Support is no longer releasing git.io URLs:

https://github.blog/changelog/2020-09-23-git-io-urls-no-longer-released-by-github-support/

@MxShift

This comment has been minimized.

Copy link

@MxShift MxShift commented Nov 30, 2020

Is this feature still working? For some reason, I couldn't create a link with my custom name, it just gave a regular JkjAa link.

UPD: I get it, just a short version of this link has already been created.

@Madhushanudeshike

This comment has been minimized.

Copy link

@Madhushanudeshike Madhushanudeshike commented Dec 16, 2020

@rokibhasansagar

This comment has been minimized.

Copy link

@rokibhasansagar rokibhasansagar commented Dec 24, 2020

Custom naming still works. 🤟
I tried shortening a gist of mine with two separate short code, sadly only first one works.

@trinib

This comment has been minimized.

Copy link

@trinib trinib commented Mar 29, 2021

ok thank you very much

@perlun

This comment has been minimized.

Copy link

@perlun perlun commented May 20, 2021

UPD: I get it, just a short version of this link has already been created.

If this happens to you (it just did to me...), use the .git hack suggested by @dikiaap in the original gist:

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.

@undecoded

This comment has been minimized.

Copy link

@undecoded undecoded commented May 22, 2021

user@debian:~$ curl https://git.io/ -i -F "url=https://raw.githubusercontent.com/undecoded/wgetqo/main/install/node12" -F "code=wgetqo/node"
HTTP/1.1 201 Created
...
Location: https://git.io/wgetqo/node
...

user@debian:~$ wget git.io/wgetqo/node
...
2021-05-22 21:48:49 ERROR 404: Not Found.

Why?

@jemadux

This comment has been minimized.

Copy link

@jemadux jemadux commented Jul 2, 2021

i

Note that a long link can only be mapped to one short link.

i didnt do it custom.... ..

@v1s1t0r999

This comment has been minimized.

Copy link

@v1s1t0r999 v1s1t0r999 commented Jul 26, 2021

Those Who all are trying to shorten their USERNAME.github.io/REPO link, If y'all face any errors,

  1. Then don't do the .git hack suggested by @koumaza here.

  2. Change your repo name a bit, and then try the same thing.

$ curl https://git.io/ -i -F "url=https://USERNAME.github.io/NEW_REPO_NAME" -F "code=CUSTOM_NAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment