Skip to main content

Install Git

Configure Git user

SSH key setup for Git

Generate an SSH key pair on the VPS (if you don’t already have one):
Ed25519 is more secure and faster than RSA. If your Git provider doesn’t support it, use -t rsa -b 4096 instead.

Add SSH key to Git provider

Display your public key:
Copy the entire output and add it to your Git provider (GitHub, GitLab, Gitea, etc.):
  • GitHub: Settings → SSH and GPG keys → New SSH key
  • GitLab: Preferences → SSH Keys
  • Gitea: Settings → SSH / GPG Keys

Test SSH connection

(Replace github.com with your Git provider’s hostname if different.)

Clone repositories over SSH

Once the SSH key is added, clone repos using the SSH URL (not HTTPS):
Do NOT commit or share your private key (~/.ssh/id_ed25519). It lives on the VPS only. If you need to share access, create a deploy user on the VPS and give them their own SSH keypair, or use a shared deploy key on the Git provider.

Useful Git commands