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

前端 未结 12 1135
醉酒成梦
醉酒成梦 2021-01-31 07:26

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 A

12条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-31 07:45

    There is two ways for Git SSH verification in Android Studio or IntelliJ, changing via: settings - Version Control - Git - SSH excuteable - "Built-in" or "Native"

    1. Built-in : means using ssh key pair built in Git for authentication. you can generate it via
      ssh-keygen -t rsa
      the default saved path is "~/.ssh/id_rsa" and "~/.ssh/id_rsa.pub". You should add the Public key in your BitBucket account. the path like : manage account - SSH keys - add keys
    2. Native : means using the ssh pair generated by the native repository hosting service, such as BitBucket or GitHub, which is often auto-add in the service account. For example in GitHub. It generated a pair of SSH key, "~/.ssh/github_rsa.pub" and "~/.ssh/github_rsa" and the Public key has been auto-added in my account via GitHub GUI maybe. So change the SSH executable to "Native" could be a simple way.

    Anyway, you can use the both way after you add the correct Public key in you acoount in repository hosting service.

提交回复
热议问题