Add this helper function to your ~/.bash_profile
(or ~/.bashrc
, or whatever you use) to create custom short links for your GitHub projects without having to remember the whole cURL command!
If you use a file other than ~/.bash_profile
to configure your terminal, substitute that value in the installation instructions below.
- Open your
~/.bash_profile
- Copy-paste the
gitlink
function into it - Save the file
- Run
source ~/.bash_profile
To create a git.io short link:
$ gitlink https://github.com/gramps-graphql
# => https://git.io/vxnTa
To specify a custom short link:
$ gitlink https://github.com/jlengstorf/bemmit bemmit
# => https://git.io/bemmit
NOTE: Custom short links can only be assigned if A) no short link has already been created for the long URL and B) the custom short link is not already in use.