Git cmd cheatsheet

ssh cmd cheatsheet

  • Delete all cached
    1
    ssh-add -D
  • Add a key
    1
    ssh-add ~/.ssh/<private key name>
  • Test ssh connection
    1
    2
    $ ssh -T git@github.com
    # Attempts to ssh to GitHub
  • Create ssh-key
    1
    ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

ssh config file ~/.ssh/config

1
2
3
4
5
Host github.com.main # <random for yourself>
HostName github.com
User git # optional
Port 22 # optional
IdentityFile ~/.ssh/id_rsa_main # Your key path