I already updated my Git for Windows. I checked the keys are correct. The only "solution" is to start
ssh-agent
Or opening VSCode via Git Bash.
So, any useful solution?
Log:
> git push origin master:master
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Add SSH key to your VM# Select Use existing public key in the dropdown for SSH public key source so that you can use the public key you just generated. Take the public key and paste it into your VM setup, by copying the entire contents of the id_ed25519. pub in the SSH public key.
You could set an remote origin using an access token (in Github) like:git remote set-url origin https://[email protected]/your-account/your-repo.git
Force push might be disabled on the master branch. Check the settings on the repo that you're trying to push to.
If force push on master is not disabled, you need to make sure that you have added your ssh key path on your ssh config, so that you don't have to add the ssh key to the session every time. Edit the config
file at ~/.ssh/config
and add the below (on MacOS)
Host *
UseKeychain yes
AddKeysToAgent yes
IdentityFile ~/path/to/key
For Windows, please check my SO answer to know how to add the ssh key to the ssh config.
UPDATE
Looks like there's an open issue with VS Code on Windows here. You may try the workaround that is mentioned here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With