Last active
January 12, 2022 11:53
-
-
Save its-dibo/8b54b86504aa990ee715c7dcea8f87f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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