Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio - Push failed: fatal: Could not read from remote repository

I have a git project at Android Studio and a remote at BitBucket and I changed it to use SSH instead of HTTPS. I can make everything work using Atlassian's SourceTree, but in Android Studio every time I try to push the project it says

Push failed: fatal: Could not read from remote repository.

Does anyone have a clue about what could be happening?

like image 948
Michel Feinstein Avatar asked Jul 11 '14 01:07

Michel Feinstein


People also ask

How resolve fatal Cannot be read from remote repository?

The Git “fatal: Could not read from remote repository” error occurs when there is an issue authenticating with a Git repository. This is common if you have incorrectly set up SSH authentication. To solve this error, make sure your SSH key is in your keychain and you connecting to a repository using the correct URL.

Does not appear to be a git repository fatal could not read from remote repository?

Note: The “fatal: 'origin' does not appear to be a git repository” error occurs when you try to push code to a remote Git repository without telling Git the exact location of the remote repository. To solve this error, use the git remote add command to add a remote to your project.

How do I fix git GitHub Permission denied Publickey fatal could not read from remote repository?

The “Permission denied (publickey). fatal: Could not read from remote repository” error is caused by an issue with the way in which you authenticate with a Git repository. To solve this error, make sure your key is being used on your Git account. If it is not, add your key to Git.


2 Answers

This is probably an Intellij problem. Your key are managed natively by ssh, and Intellij has it's own ssh program.

Go to the settings, search git->ssh executable then choose native

As seen here : git with IntelliJ IDEA: Could not read from remote repository

like image 89
Nicolas Zozol Avatar answered Sep 18 '22 04:09

Nicolas Zozol


Go to Settings > Version Control > Git. Make sure SSH executable is set to “Native.”

If it's already set, switch back to “Built-in,” apply it, and then again switch back to “Native".

enter image description here

like image 26
Johnny Avatar answered Sep 20 '22 04:09

Johnny