2

谁能帮忙,我在 Windows 上,git 正在使用我的源设置为 github。

当然,每次我希望拉/推或任何我需要为 github 提供密钥的密码时。

根据我所阅读的内容,我需要编辑 ~/.profile 或 ~/.bashrc 并输入一些文本

https://help.github.com/articles/working-with-ssh-key-passphrases

我已经这样做了很多次,我实际上在两个文件中都输入了它,但是当我打开一个新的 GitBash 窗口时,似乎什么都没有运行(我假设某些东西应该运行并根据上面的链接询问我的密码)。

因此,当然,每次 Push 或 Pull 都会再次要求我输入密码。

我显然在这里遗漏了一些东西,有人可以帮忙吗?

记住我在 Windows 上 :-) 并使用 git 附带的 gitbash for windows。

提前致谢

4

3 回答 3

3

好吧,经过大量调查,我发现了这个记住密码,Windows下的Git bash

它准确地解释了需要什么,它与它出现的 linux 不同。

于 2012-08-26T04:39:37.817 回答
1

如果您通过“https”方法克隆了存储库,现在尝试以“ssh”方式或其他方式进行推送/拉取,则可能会发生这种情况。看看这是否适合你:

git remote set-url origin git@github.com:your_account/your_repo.git
于 2012-08-15T15:46:02.843 回答
0

在 Windows 10 上,这对我有用

  1. 运行 git bash
  2. touch ~/.profile
  3. start ~/.profile打开.profile
  4. 将以下内容添加到.profile
#! /bin/bash 
eval `ssh-agent -s` 
ssh-add ~/.ssh/*_rsa

这是基于这个答案。唯一的区别是.bashrc没有工作,而是.profile工作。

于 2016-05-04T11:40:12.983 回答