为什么 git 要求我输入密码?
我正在使用 Windows XP、TortoiseGit(最新版本)和 Cygwin。我已经安装了 git.exe 并在我的路径上。在 TortoiseGit 中,我可以对远程存储库执行推送,而不会提示输入密码。我认为这是因为我已经在 .git/config 文件中定义了这一点...
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = ssh://git@myrepo/myproject.git
puttykeyfile = U:\\.ssh\\mykey.ppk
但是,在 Cygwin 中,当位于我的项目的根目录(.git 文件夹是子目录的目录)时,系统会提示我输入密码 ...
$ git push origin qa_release
git@myrepo's password:
为什么当我尝试从 Cygwin 推送而不是从 TortoiseGit 推送时会提示输入密码,如何让 Cygwin 表现得像 TortoiseGit (即不要求我输入密码)?
谢谢,-戴夫
I'm using Windows XP, TortoiseGit (latest version) and Cygwin. I have git.exe installed and on my path. In TortoiseGit, I can execute pushes against the remote repository without being prompted for a password. I assumed this was because I have defined this in my .git/config file ...
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = ssh://git@myrepo/myproject.git
puttykeyfile = U:\\.ssh\\mykey.ppk
However, in Cygwin, when at the root directory of my project (the one where the .git folder is a child), I get prompted for a password ...
$ git push origin qa_release
git@myrepo's password:
Why am I prompted for a password when trying to push from Cygwin but not from TortoiseGit and how can I get Cygwin to behave like TortoiseGit (i.e. not ask me for a password)?
Thanks, - Dave
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
puttykeyfile 是 Windows git 的东西,所以你也需要为 cygwin 设置 SSH。 Git 将使用您的常规 SSH 设置。
.ppk 文件是常规 SSH 公钥吗?如果是这样,请将以下内容添加到您的
~/.ssh/config
文件中,以便 cygwin git 知道在哪里可以找到它。您可以在 cygwin 中使用
ssh myrepo
快速测试这一点。puttykeyfile
is a windows git thing, so you need to have your SSH set up for cygwin too. Git will use your regular SSH settings.Is the .ppk file a regular SSH public key? If so, add the following to your
~/.ssh/config
file, so cygwin git knows where to find it.You can test this quickly with a
ssh myrepo
in cygwin.