目标是在不提供任何密码的情况下克隆 Visual Studio Team Services 中的 Git 存储库。进一步的目标是完全非交互式地完成,根本没有任何提示。
问题描述:
操作系统是Windows Server 2016。假设我的用户名是batman。我已经在 Windows 中设置了私钥(没有密码)C:\Users\batman\.ssh\id_rsa。
我在 VSTS 上为我的用户帐户添加了公钥。都好。
我想克隆存储库,VSTS Web UI 为我提供了一个存储库的 SSH URL。我在我执行的以下命令中使用它:
git clone ssh://mycompany@mycompany.visualstudio.com:22/MyProject/_git/MyRepo
响应:
Cloning into 'MyRepo'...
Enter passphrase for key '/c/Users/batman/.ssh/id_rsa':
mycompany@mycompany.visualstudio.com's password:
Run Code Online (Sandbox Code Playgroud)
所以首先它会要求输入密钥密码,我只需按 Enter 键,但最后一行令人困惑。我应该输入什么密码,为什么要问它?怎么让它不问呢?如何使克隆命令根本不问任何问题?