Created
March 15, 2012 13:16
-
-
Save metaskills/2044146 to your computer and use it in GitHub Desktop.
A Git.io URL Shortener Console Function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you are not on a Mac and do not want the URL | |
# copied to the clipboard, remove the pbcopy command. | |
function gitio () { | |
local url=$(curl -s -i http://git.io -F "url=$1" | grep "Location: " | cut -d" " -f2 | tr "" "\n") | |
echo "$url" | pbcopy | |
echo $url | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage is simple. The URL will be copied to your clipboard and echoed.