Shorter Git Remotes

Post date
Reading time
2 Minute Read

When using Bitbucket, you can end up with quite unwieldy Git URLs:

git clone ssh://

To save copying the URL from the UI any time you clone a new repository, add the following to your ~/.ssh/config:

Host bb
    User git
    Port 7999

If you’re using a separate IdentityFile, you can add this here as well.

This means clone commands can be much cleaner:

git clone bb:project/repo

The same is true for GitHub URLs:

Host gh
    User git

And the clone command is the same:

git clone gh:username/repository

Leave a Reply