How to get Github Vanity url through Git.io?

If your Github user name is already taken by somebody (I typically choose thiru, but taken by somebody, so I had to choose ithiru). But if you want to share the url with others and still want to use thiru, you can do it through Github url shortener Git.io.

Use the following command and you should be able to get it. Please do not try the web version @ git.io, it will auto generate and if you try to do it again through command line it will return the same shortened url.

-F "code=vanity"

will make sure you get the custom url rather than generated one.

$ curl -i https://git.io -F "url=https://github.com/ithiru" -F "code=thiru"
HTTP/1.1 100 Continue

HTTP/1.1 201 Created
Server: Cowboy
Connection: keep-alive
Date: Thu, 22 Sep 2016 05:05:35 GMT
Status: 201 Created
Content-Type: text/html;charset=utf-8
Location: https://git.io/vi76a
Content-Length: 25
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Runtime: 0.256529
X-Node: 27a81f0a-cb95-4f6d-94d6-0c9891e3714b
X-Revision: 4fdc60de6311e6a3aa31e19bc7b3aad7e85d33a6
Strict-Transport-Security: max-age=31536000; includeSubDomains
Via: 1.1 vegur

In case you by mistake tried @ https://git.io via Browser, you can try the anchor trick to fool git.io that the url is unique.

$ curl -i https://git.io -F "url=https://github.com/ithiru#start-of-content" -F "code=thiru"
HTTP/1.1 100 Continue

HTTP/1.1 201 Created
Server: Cowboy
Connection: keep-alive
Date: Thu, 22 Sep 2016 05:12:47 GMT
Status: 201 Created
Content-Type: text/html;charset=utf-8
Location: https://git.io/thiru
Content-Length: 42
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Runtime: 0.255721
X-Node: 722fe806-9844-4265-9a8f-c51d2c170cf7
X-Revision: 4fdc60de6311e6a3aa31e19bc7b3aad7e85d33a6
Strict-Transport-Security: max-age=31536000; includeSubDomains
Via: 1.1 vegur

via Github Blog

Leave a Reply

Your email address will not be published. Required fields are marked *