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?
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.
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.
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.
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
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".
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