Skip to content

Instantly share code, notes, and snippets.

@its-dibo
Last active January 12, 2022 11:53
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 its-dibo/8b54b86504aa990ee715c7dcea8f87f5 to your computer and use it in GitHub Desktop.
Save its-dibo/8b54b86504aa990ee715c7dcea8f87f5 to your computer and use it in GitHub Desktop.
## generating a SSH key for a github account (i.e: login to your github account in the local machine)
//1- in the local machine:
$ git config --global user.name "John Doe"
$ git config --global user.email github@email
//check for existing key:
ls -al ~/.ssh
//or generate a new key
ssh-keygen -t ed25519 -C "github@email"
> Enter a file in which to save the key (press enter)
> Enter passphrase (press enter twice)
$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/id_ed25519
//copy the key
$ nano ~/.ssh/id_ed25519.pub
# or:
$ clip < ~/.ssh/id_ed25519.pub
//2- in github:
/*
settings -> SSH anf GPG keys -> new SSH key -> paste the generated SSH
*/
// generate personal tolen
https://github.com/settings/tokens
$ git remote set-url origin https://<personal_access_token>@github.com/<your_username>/<repo_name>.git
$ git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment