How can you get the right access key to push in my git work to my github repo? - github

i encountered this problem while trying to push to my accountvia terminal, working on a site
and it kept giving me that fatal error "Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists."
i have tried getting access to another SSH key but still not working.

https://docs.github.com/en/authentication/connecting-to-github-with-ssh
This article would help you solve the problem.
Generate an ssh key
Add it to your account
Refresh the project both on github
On your command line and run the git command again.

Related

yet again problems with ssh key... but this time on github

So, I have my pubkeys on github.
Somehow from one of my devices I can't push commits..
> git pull --tags origin main
git#github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
of course I checked the ssh keys on my github page, thinking that maybe I forgot to put this specific device key in it.
but when I try to add it it tells me the key is already there.
Then I tried to connect through ssh to my github account and of course it works.
Hi mosfetti! You've successfully authenticated, but GitHub does not provide shell access.
What should I do?
Thanks
(Windows 10)
apparently something was rong with origin url..
still don't know why..
solved by adding the origin again
git remote set-url origin https://github.com/myuser/myrepo

GitHub ssh keys - ssh test works but using git clone returns permission denied

I've been working on this for a few hours now and I've read everywhere but am officially stumped.
I'm trying to set up ssh keys for a dev-environment to interact with github. I've followed the guide on github and have made the keys and when I test them using the git#github.com it works but when I use git clone git#github.com:username/repo I get
Cloning into 'reponame'...
git#github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
I've tried adding it to ssh-add and that works, ssh-agent is running and has access. I've looked at the environment variable and set it to ssh among a few other things. I don't know what else to try. Let me know what logs I can post to help.
My thoughts are maybe the git command isn't using the identities or the right ssh client but other than the environment variables I'm not sure what else to change.
Thanks for the help in advance.

fatal: cannot run /snap/code/79/usr/share/code/resources/app/extensions/git/dist/askpass.sh: No such file or directory

I have been trying to push the code to Github but getting error as below.
$ git push fatal: cannot run
/snap/code/79/usr/share/code/resources/app/extensions/git/dist/askpass.sh:
No such file or directory
Iam able to push by providing username and Personal access Token but it valid for only in that push command. Next time when i try to push the code it is again asking for credentials followed by the error.
One solution that worked for me was to restart VS Code
Ya, simply restart your vs code and it will ask then for permission from GitHub
when you will push your code to remote

IntelliJ Github Issue

Trying to push a project to github and I'm getting the following Error
remote: Permission to RedNetty/RedPractice.git denied to JackCDev.
fatal: unable to access 'https://github.com/RedNetty/RedPractice.git/': The requested URL returned error: 403
The issue isn't as simple as me going into Settings > Version Control > Github
I've already changed that but its still trying to push via the wrong account.
Check if you have a git **credential helper**active:
git config credential.helper
For instance, on Windows, that would be the Windows Credential Managers.
Open the Windows Credential Store, and see if the first user is registered there: delete that entry, and you will be able to authenticate with the second user.
(Here is an example for BitBucket)

GitHub, SSH & OS X Keychain Access

Setting up GitHub, and Im using SSH to connect. Following along hereto get all SSH set up. All is working well until i try to push an existing repository from the command line.
No problems with the following
git remote add origin git#github.com:<username>/first_app.git
But when I execut the following
git push -u origin master
things stop working.
My Keychain access dialog window pops up and wants the id_rsa password. Isn't this the passphrase I made up when i was following the steps on GitHub's how-to setup SSH? I think it is, but Keychain won't take the passphrase (I'm using this interchangeably with the word password).
I get: Permission denied (publickey).
fatal: Could not read from remote repository.
Can someone please help me connect the last piece of this puzzle so I can connect to GitHub via SSH? Thanks