Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note: if the only difference in filenames between the private key and the public key is that the public key ends in .pub, then you can use the path to private key in the above command as well.

Configuration

GitHub SSH URLs are cumbersome to type, can I make them shorter?

Yes, by adding a host alias for github.com in your SSH configuration file ~/.ssh/config. Add the following lines to ~/.ssh/config:

Code Block
languagetext
Host github.com github gh
User git
Hostname github.com

You can now clone from GitHub using the aliases listed after Host:

Code Block
languagebash
$ git clone github.com:openjdk/jdk
$ git clone github:openjdk/jdk
$ git clone gh:openjdk/jdk