Skip to content

Instantly share code, notes, and snippets.

@sab99r
Last active March 17, 2022 10:33
Show Gist options
  • Save sab99r/7b2470dbd9eb09bdb6ab88b96376f743 to your computer and use it in GitHub Desktop.
Save sab99r/7b2470dbd9eb09bdb6ab88b96376f743 to your computer and use it in GitHub Desktop.
Github SSH Setup

Check SSH Key exist

cd ~/.ssh

Generate New SSH Key (If Not Exist)

ssh-keygen -t ed25519 -C "[email protected]"
# Press Enter to save in default directory
# Enter Password on prompt

Copy the SSH Public Key

cat < ~/.ssh/id_ed25519.pub
# Copy the output

Add the Copied SSH Public Key @Github

https://github.com/settings/ssh/new

Test the SSH Authentication

Update Git Config File in repo

nano .git/config
#Replace remote "origin" url (which starts with https) with Githhub ssh URL... then save

Done.

In case if you still not able to pull/push execute

# git init again in the same repo to fix the issue

Referense

StackOverFlow #1 StackOverFlow #2

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