git url shortcuts

You can create shortcuts for git URL paths to clone without typing full URL.

Add the following to your .gitconfig file:

[url "https://github.com/"]
    insteadOf = github:
    insteadOf = gh:

[url "git@github.com:"]
    pushInsteadOf = github:
    pushInsteadOf = gh:

[url "https://gitlab.com/"]
    insteadOf = gitlab:
    insteadOf = gb:

[url "git@gitlab.com:"]
    pushInsteadOf = gitlab:
    pushInsteadOf = gb:
# With this configuration, you can clone your repositories using url shortcuts
git clone gh:l-lin/dotfiles
# instead of
git clone git@github.com:l-lin/dotfiles