使用私钥的 Android Studio git [英] Android studio git using private key
问题描述
A 有一个 git 仓库地址.
我还有一个 open-ssh 格式的私钥.
Android Studio 中的 git 是否可以使用它?
我试图搜索一些信息,但这次没有运气.
感谢您提供任何有用的信息!
A have an address of git repository.
Also I have a private key in open-ssh format.
Is it possible for git in Android Studio to use it?
I tried to search some info, but no luck at this time.
Thanks for any useful information!
编辑.我的步骤:
1. 我将我的私钥放在 .ssh 文件夹中(用户/用户).
2. 在 Android Studio 中,我运行:文件 - 设置 - 版本控制 - Git 并输入 Git 可执行文件的路径.
3. 然后是 VCS - Checkout from vesrion control - Git.我把存储库地址放在那里.
Edit. My steps:
1. I put my private key in .ssh folder (Users/user).
2. In Android studio I run: File - Settings - Version Control - Git and put the path to Git executable.
3. Then VCS - Checkout from vesrion control - Git. I put repository address there.
如果我继续在这里,有:
If I continue here, there is:
但我没有用户名和密码,只有密钥.
如果我尝试:
得到以下内容:
But I don't have username and password, only key.
If I try:
got the following:
Android Studio 如何知道它应该使用我的私钥而不是标准的 id_rsa 文件?
推荐答案
好的,终于搞定了!
我所做的 - 切换到 .ssh 文件夹,然后将 id_rsa
密钥的内容(据我了解,这是 Android Studio 的默认 ssh 密钥)替换为我的 ssh 密钥
的内容.
Ok, finally got it working!
What I did - switched to .ssh folder, then replaced contents of id_rsa
key (as I understand, this is default ssh key of Android Studio) with contents of my ssh key
.
仍然不知道方法,我如何将 Android Studio 指向我的 ssh 密钥
,但它以这种方式工作.
Still don't know the way, how can I point Android Studio to my ssh key
, but in such way it works.
这篇关于使用私钥的 Android Studio git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!