Skip to content

Instantly share code, notes, and snippets.

@ricoms
Forked from developius/README.md
Last active July 15, 2019 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ricoms/5d6baa05b5f457d09545500e5cba15f2 to your computer and use it in GitHub Desktop.
Save ricoms/5d6baa05b5f457d09545500e5cba15f2 to your computer and use it in GitHub Desktop.
Set up GitHub push with SSH keys

Requirements

sudo apt-get install xclip

Preparation

Generate ssh key:

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

In a step for the command above you will create a filename for your ssh key. I chose git.

Copy the contents of the file ~/.ssh/git.pub:

xclip -sel clip < ~/.ssh/git.pub

to your SSH keys in your GitHub account settings.

Test SSH key

ssh -T git@github.com
git clone git://github.com/<username>/<your-repository>
git remote set-url origin git@github.com:<username>/<your-repository>.git
git add -A
git commit -am "my update msg"
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment