Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

git push without password

1. switch origin to ssh mode
$ git remote -v
> origin  https://github.com/<your_name>/<repo_name>.git (fetch)
> origin  https://github.com/<your_name>/<repo_name>.git (push)

$ git remote set-url origin git@github.com:<your_name>/<repo_name>.git

2. register your computer ssh key to your github account
$ ssh-keygen -t ed25519 -C "your_email@example.com"
> Enter passphrase (empty for no passphrase): [Type a passphrase]
> Enter same passphrase again: [Type passphrase again]

$ cat ~/.ssh/id_ed25519.pub
  # Then select and copy the contents of the id_ed25519.pub file
  # displayed in the terminal to your clipboard
  # then go to https://github.com/settings/keys
  # paste key in, give it a name and save


Overall: there's 2 things need done
1. switch origin to ssh mode: 
details: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
2. register your computer ssh key to your github account
details: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account
 
PREVIOUS NEXT
Tagged: #git #push #password
ADD COMMENT
Topic
Name
2+2 =