Repository navigation
Permission denied (publickey). fatal: Could not read from remote repository. #46
Description
Activity
This sounds like an issue with your configuration and not the repository itself.
Reacted by amitai- Config prob as in? What cn i do?…On Fri, Feb 17, 2017 at 11:26 AM, yburyug ***@***.***> wrote: This sounds like an issue with your configuration and not the repository itself. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#46 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/APayeuCtOj2cOLGdXnO7TDYV1dHrRB1Fks5rdTZ8gaJpZM4MD41G> .
It seems as if you removed the origin remote when you met to remove the directory that conflicted with your clone. Try this:
$ cd $ mkdir tmp $ cd tmp $ git clone <the repo> $ cd <the repo>and see if it works. There seem to be local conflicts.
Reacted by Abhinaba Bala , remon25, pmov, Bilal Ahmad, Beatriz, Peter Pan and shamanthshamstill i have an error for Please make sure you have the correct access rights
and the repository exists.Reacted by rameshrebari, Gokhan Karakus, James Hubert, kforkumar002, vasugryarasu, Avinash, Aditi Arya, prethi-aifuse, Umesh Chandra Juyal, Jakak and 1 moreI have to, but how can I solve it
Use HTTPS one and reset your git
Reacted by Kunal Choudhary, slawinski, Jay, Z3R0, riley-earls, Albert, Parth Dadhaniya, Fida Eshad, thedevtechs, PegasUsOnce and 1 moreReacted by Kan, SAGAR BUDDHI, Kaps Patel, suraj bhadrike, tunde Ayodele, gevonerd, James Lawson, Ganga B, Stephan Nordnes Eriksen, Kirill Konishev and 7 moreI resolved this error by changing ssh to http from git repos
Reacted by Carlos Anriquez, JaMia Moore, Klaudia Wójciak, Da Jiang, Tri Nanda, ichiroyamato, titojunior1, mnreddy1986, prabh9292, Baran and 24 moreReacted by Walter Vides, Karl, pamelaskaff and Sam HollenbachReacted by Baran, Abhishek Mishra, Tushar Khanna, Kunal Choudhary, Daman Sharma, yashvimehta, Avinash, sandhya2009, Alan Rebane, Anup Kushwaha and 1 morei resolved this error by using https instead of ssh
Reacted by elig0n, nvaishnavi, Kunal Choudhary, riley-earls, Parth Dadhaniya, Fida Eshad, Boris Mateev and Newtan Ananda Gopal MukhopadhyayReacted by Karl and Abhishek Gauravi use https but still have the same issue...
i use https but still have the same issue...
my too
I solved same problem by adding below lines to
C:\Users\myuser\.ssh\configfile:Host example.com AddKeysToAgent yes IdentityFile /D/Documents/PPK/myprivatekey.ppkssh -vvv git@example.comshowed me some insights like the file name it tried to use, auth method it tries etc.Note that if you use forward slashes it works in
bash(mingw) but not inCMDand with back slashes it works inCMDbut not inbash.Reacted by Robert Mariano Schwindaman, xrmmartin, Taneisha S. Mitchell and Gürcan KavakçıReacted by Robert Mariano Schwindaman and xrmmartinReacted by Erin Kenna, Pavel Karateev, Slawek Jurczyk, Robert Mariano Schwindaman, xrmmartin and Francisco Ferrinhoupdate your git version
Solution is so simple, Use
https://github.com/wanted-repository.gitversion instead ofgit@github.com:wanted-repository.git.you can also clone
git@githubwhich is SSH version but for that you have to generate ssh keys and have to set it in local environment and if you don't want to set up that then just usehttpsversion that's it.Reacted by Haritsinh Gohil, adarsh pandey, Kan, Yiou (Leo) Li, Joel Genter, JR Leonard, Pranav Vartak, Nikita Kolotilo, Andrew Johnson, MawaMaverick and 21 moreReacted by Dmitry S., Andrii Antonov, xrmmartin, Edward Chagirov, Vignesh, Walter Vides, Karl, vvahanov-ias and CrystalRaineReacted by Haritsinh Gohil, Joel Genter, JR Leonard, MawaMaverick, Nancy Onukogu, patzha and amit thakurReacted by Haritsinh Gohil, Daniel Garcia Rodriguez, Dhruv Kabariya, MawaMaverick, Johnzu-2019, Artem Klots, Chitaranjan Biswal, Vipul Chandra, patzha, popcount43 and 2 moreReacted by Haritsinh Gohil, meite-root, MawaMaverick, Artem Klots, patzha and amit thakurbash.exe"-3.1$ git push -f origin master
Permission denied (publickey).
fatal: Could not read from remote repository.Please make sure you have the correct access rights
and the repository exists.
bash.exe"-3.1$
How to push my android code to a repository provided by another account? He provided me git repository to submit my android code but I can't push it to his repository. Plz help.Solution is so simple, Use
https://github.com/wanted-repository.gitversion instead ofgit@github.com:wanted-repository.git.you can also clone
git@githubwhich is SSH version but for that you have generate ssh keys and have to set it in local environment and if you don't want to set up that then just usehttpsversion that's it.this works:)
Reacted by Haritsinh Gohil, Nancy Onukogu and AlexMkoyanReacted by Karl and melkharbiliReacted by AlexMkoyanReacted by muxtarHesenovReacted by AlexMkoyan9 remaining items
I had to change the URL
git remote set-url origin <new_https_url>Reacted by Tushar Khanna, Ronnie Rasouli, Sam R and Maciekssh -vvv git@example.comshowed me some insights like the file name it tried to use, auth method it tries etc.I'm also using a ~/.ssh/config file and @endo64's suggestion of
ssh -vvv git@github.comreally helped me.debug1: Trying private key: /home/<user>/.ssh/<name_of_key_file> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0664 for '/home/<user>/.ssh/<name_of_key_file>' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. Load key "/home/<user>/.ssh/<name_of_key_file>": bad permissionsI'd forgotten to check and put appropriate permissions on the key file.
i.e.chmod 600 ~/.ssh/<name_of_key_file>Trying ssh again, the next problem for me was that the private key file generated by PuttyGen was not an acceptable format. So I had to reload and export it as OpenSSH in PuttyGen and replace it in my .ssh dir.
Trying ssh again yielded, "You've successfully authenticated, but GitHub does not provide shell access."
At this point git clone using ssh worked for me.
change the origin master link from git@github.com to https://github.com , if confused simply copy the browser url link and save it as origin
Reacted by sedgholmSome repository required to fork for having required permission to push to it by creating some feature branch.
If you are contributing to some other account repository then note this 2 things -
- You must have a public key set in your account for the collaboration process.
- Fork before cloning the project.
Reacted by sdiener17It seems as if you removed the origin remote when you met to remove the directory that conflicted with your clone. Try this:
$ cd $ mkdir tmp $ cd tmp $ git clone <the repo> $ cd <the repo>and see if it works. There seem to be local conflicts.
Repository "......" doesn't exist
In my case, the ssh agent was not running on my server.
git cloneetc. worked after I ran the following commads:$ eval `ssh-agent -s` $ ssh-add ~/.ssh/id_rsaReacted by Dmitry S., Rangaswini, Wenyu Jiang, Kelton Temby, Nelya Feshchenko, Himanshu Joshi and Vanessa NicoleReacted by Himanshu JoshiReacted by Himanshu JoshiReacted by Himanshu JoshiReacted by Himanshu JoshiReacted by Himanshu Joshisuggestion of ssh -vvv git@github.com really helped me.
In my case I have resolved this issue by keeping the key name as "id_rsa" which is default. While generating the New Key on CPanel => Manage SSH Key I had kept the keyname as my projectname. That was causing the issue. One thing we should keep in mind that Either use the default "id_rsa" while generating SSH Key or Add the custom key name on ssh directory
Path: /home//.ssh/Thanks everyone for the help.
Warning: Permanently added the RSA host key for IP address '64:ff9b::dea:b066' to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.bash.exe"-3.1$ git push -f origin master
Permission denied (publickey).
fatal: Could not read from remote repository.Please make sure you have the correct access rights
and the repository exists.
bash.exe"-3.1$
How to push my android code to a repository provided by another account? He provided me git repository to submit my android code but I can't push it to his repository. Plz help.while push I used
git push origin master (i was asked for credentials , i provided and it worked )
Now on another server after ..
git remote add origin (github folder url )
git pull origin master (I am getting the below error)(" git pull origin master
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 solved same problem by adding below lines to
C:\Users\myuser\.ssh\configfile:Host example.com AddKeysToAgent yes IdentityFile /D/Documents/PPK/myprivatekey.ppkssh -vvv git@example.comshowed me some insights like the file name it tried to use, auth method it tries etc.Note that if you use forward slashes it works in
bash(mingw) but not inCMDand with back slashes it works inCMDbut not inbash.This worked for me.
After 2 hours of rummaging through internet I got through this solution and it worked like a charm!!!
Somehow two ssh ids got created in my .ssh folder and due to which the config file got messed up.
Just changed the "host github-username" to "host github.com" and removed the line "hostname github.com" and bang !!! everything worked as it should.git clone -b Termux-Support-Branch https://github.com/DarkSecDevelopers/HiddenEye.git
Cloning into 'HiddenEye'...
fatal: Remote branch Termux-Support-Branch not found in upstream originHelp
I solved the same problem by replacing origin with the url of the repo git push https://github.com/reactjs/hi.reactjs.org.git master It worked for me.
thank you its working for me
I solved the same problem by replacing origin with the url of the repo git push https://github.com/reactjs/hi.reactjs.org.git master It worked for me.
Thank you.
I solved the same problem by replacing origin with the url of the repo git push https://github.com/reactjs/hi.reactjs.org.git master It worked for me.
thak you so much, it really worked, but, just curiose, how did you get to that solution?


I am not able to run these commands. I tired cloning over https still same error
Administrator@aastha MINGW64 /g/All-Around-Apparel-master (master)
$ git push
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Administrator@aastha MINGW64 /g/All-Around-Apparel-master (master)
$ git remote show origin
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Administrator@aastha MINGW64 /g/All-Around-Apparel-master (master)
$ git remote add origin git@github.com:DBegrajka/All-Around-Apparel.git
fatal: remote origin already exists.
Administrator@aastha MINGW64 /g/All-Around-Apparel-master (master)
$ git push origin master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Administrator@aastha MINGW64 /g/All-Around-Apparel-master (master)
$ git pull origin master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Administrator@aastha MINGW64 /g/All-Around-Apparel-master (master)
$ git remote add origin https://github.com/DBegrajka/All-Around-Apparel.git
fatal: remote origin already exists.
Administrator@aastha MINGW64 /g/All-Around-Apparel-master (master)
$ git clone https://github.com/DBegrajka/All-Around-Apparel.git
fatal: destination path 'All-Around-Apparel' already exists and is not an empty directory.
Administrator@aastha MINGW64 /g/All-Around-Apparel-master (master)
$ git remote rm origin git remote add origin ^C
Administrator@aastha MINGW64 /g/All-Around-Apparel-master (master)
$