cloudtunes icon indicating copy to clipboard operation
cloudtunes copied to clipboard

Permission denied (publickey). fatal: Could not read from remote repository.

Open aasthabapna opened this issue 7 years ago • 39 comments

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 [email protected]: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) $

aasthabapna avatar Feb 17 '17 05:02 aasthabapna

This sounds like an issue with your configuration and not the repository itself.

ybur-yug avatar Feb 17 '17 05:02 ybur-yug

Config prob as in? What cn i do?

On Fri, Feb 17, 2017 at 11:26 AM, yburyug [email protected] 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 https://github.com/jkbrzt/cloudtunes/issues/46#issuecomment-280560636, or mute the thread https://github.com/notifications/unsubscribe-auth/APayeuCtOj2cOLGdXnO7TDYV1dHrRB1Fks5rdTZ8gaJpZM4MD41G .

aasthabapna avatar Feb 17 '17 05:02 aasthabapna

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.

ybur-yug avatar Feb 17 '17 06:02 ybur-yug

still i have an error for Please make sure you have the correct access rights and the repository exists.

geesdiir avatar Mar 29 '18 19:03 geesdiir

I have to, but how can I solve it

MaxWillBeBest avatar May 08 '18 12:05 MaxWillBeBest

Use HTTPS one and reset your git

tripulse avatar May 14 '18 14:05 tripulse

I resolved this error by changing ssh to http from git repos

rameshrebari avatar May 28 '18 11:05 rameshrebari

i resolved this error by using https instead of ssh

mnreddy1986 avatar Dec 04 '18 11:12 mnreddy1986

i use https but still have the same issue...

mrilyaskarimov avatar Dec 09 '18 15:12 mrilyaskarimov

i use https but still have the same issue...

my too

mohamedsami0 avatar Dec 24 '18 12:12 mohamedsami0

I solved same problem by adding below lines to C:\Users\myuser\.ssh\config file:

Host example.com
  AddKeysToAgent yes
  IdentityFile /D/Documents/PPK/myprivatekey.ppk

ssh -vvv [email protected] showed 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 in CMD and with back slashes it works in CMD but not in bash.

endo64 avatar Jan 03 '19 13:01 endo64

update your git version

farassharp avatar Apr 09 '19 17:04 farassharp

Solution is so simple, Use https://github.com/wanted-repository.git version instead of [email protected]:wanted-repository.git .

you can also clone git@github which 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 use https version that's it.

Haritsinh avatar Jun 25 '19 07:06 Haritsinh

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.

smasish avatar Jun 28 '19 00:06 smasish

Solution is so simple, Use https://github.com/wanted-repository.git version instead of [email protected]:wanted-repository.git .

you can also clone git@github which 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 use https version that's it.

this works:)

adarshpandey avatar Sep 15 '19 16:09 adarshpandey

its not working still it show same error

nerugattiraju avatar Oct 26 '19 12:10 nerugattiraju

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.

aliana17 avatar Oct 26 '19 18:10 aliana17

After days of attempting different solutions this worked for me, thanks

Jaliov avatar Nov 05 '19 13:11 Jaliov

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.

thanks it works for me

bhaveshrathod741 avatar Nov 25 '19 19:11 bhaveshrathod741

Added

host my_host
     IdentityFile ~/.ssh/id_rsa

in /etc/ssh/ssh_config

was the right thing to do for me

Hope this help

PhilippeDo avatar Dec 18 '19 15:12 PhilippeDo

I have just fixed the issue by following these steps : git remote rm origin // for removing the existing connection git remote add origin https://github.com/username/filename.git git push -u origin master

shivagh514 avatar Dec 23 '19 08:12 shivagh514

Open command prompt as administration and run below command git push origin master --force

ShahidHussainAbbasi avatar Dec 26 '19 18:12 ShahidHussainAbbasi

Open command prompt as administration and run below command git push origin master --force

ShahidHussainAbbasi avatar Dec 27 '19 05:12 ShahidHussainAbbasi

Thanks shivagh514. I have also faced the same problem:

$ git push -u origin 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._

have fixed the issue by following these steps : $ git remote rm origin

Sumankkundu avatar Dec 31 '19 12:12 Sumankkundu

I had to change the URL git remote set-url origin <new_https_url>

nikhilkadu avatar Jan 12 '20 09:01 nikhilkadu

ssh -vvv [email protected] showed 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 [email protected] really 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 permissions

I'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.

ErinKenna avatar Feb 18 '20 04:02 ErinKenna

change the origin master link from [email protected] to https://github.com , if confused simply copy the browser url link and save it as origin

nilanjandutta avatar Feb 18 '20 08:02 nilanjandutta

Some repository required to fork for having required permission to push to it by creating some feature branch.

himharsh1997 avatar Mar 04 '20 18:03 himharsh1997

If you are contributing to some other account repository then note this 2 things -

  1. You must have a public key set in your account for the collaboration process.
  2. Fork before cloning the project.

himanshu199728 avatar Apr 18 '20 19:04 himanshu199728

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.

Repository "......" doesn't exist

harshraj1234 avatar May 14 '20 19:05 harshraj1234