Skip to content

Instantly share code, notes, and snippets.

@MSayib
Last active July 2, 2024 17:30
Show Gist options
  • Save MSayib/5d55462963646a265c956d98722cdadf to your computer and use it in GitHub Desktop.
Save MSayib/5d55462963646a265c956d98722cdadf to your computer and use it in GitHub Desktop.
Setup Git over SSH

Linux:

ssh-keygen -t ed25519 && cat /home/YOUR_USERNAME/.ssh/id_ed25519.pub

MacOS:

ssh-keygen -t ed25519 && cat /Users/YOUR_USERNAME/.ssh/id_ed25519.pub

Copy the value from id_ed25519.pub

Go to : https://github.com/settings/keys

  • New SSH Key
  • Name the title
  • Choose Authentication Key
  • Paste the key value and submit.

Test your SSH Connection to Github:

ssh -T git@github.com

Clone:

git clone git@github.com:YOUR_USERNAME/YOUR_REPO.git

Set current project to SSH:

git remote set-url origin git@github.com:YOUR_USERNAME/YOUR_REPO.git

try git pull or commit and push something. Enjoy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment