使用cygwin的Git存储https密码

Cim*_*Cim 33 windows git passwords cygwin bitbucket

我正在使用Cygwin和Git.每当我用https url推送/拉到Bitbucket的回购时,我都会被要求输入密码.有没有办法存储这些凭据(比如使用ssh-keys)?

我试图为Git安装Windows Credential Store但是我不能让它与cygwin的Git一起工作.

谢谢!

更新:

我在这里找到了答案:在GitHub上使用https://时是否有办法跳过密码输入?

总结如下:

记住密码15分钟(默认):

git config --global credential.helper cache
Run Code Online (Sandbox Code Playgroud)

记住密码10小时:

git config --global credential.helper 'cache --timeout=36000'
Run Code Online (Sandbox Code Playgroud)

存储密码(没试过这个):

git config --global credential.helper store
Run Code Online (Sandbox Code Playgroud)

重启:

git config --unset --global credential.helper
Run Code Online (Sandbox Code Playgroud)

升麻

Gen*_*sky 24

OP回答他自己的问题的方式是一种方法.

Windows凭据店项目是在2015年停止了原作者建议使用Git的凭据管理器为Windows,Microsoft维护.他们的安装程序专注于Git for Windows,但程序本身适用于Cygwin,您只需手动安装它.

GCMW的最新版本,下载zip文件(未安装),提取其内容(仅.dll.exe文件需要)到C:\cygwin\usr\libexec\git-core\32位Cygwin的,或C:\cygwin64\usr\libexec\git-core\为64位Cygwin的.参考

要让git使用GCMW,请执行: git config --global credential.helper manager

要获取凭据的GUI提示,请执行: git config --global credential.modalprompt true

如果您希望将此设置为每个存储库设置,请删除该--global选项.

  • GCMFW 现在(或很快?)已过时。以下调整后的解决方案适用于新的跨平台 git-credential-manager-core。从 Git Credential Manager Core zip 中移动所有 exe/dll 后,只需使用 `git config --global credential.helper manager-core` 新实用程序位于:https://github.com/microsoft/Git-Credential-Manager-核心/版本 (4认同)
  • 最后一个提示,确保在将这些文件复制到 `git-core` 后使用 `chmod a+x *.{exe,dll}`。否则,您会看到类似“'credential-manager' 不是 git 命令”这样的错误,因为 git-credential-manager.exe 不可执行。 (3认同)

Mar*_*cak 18

我让Windows Credential Store与cygwin合作.唯一需要改变的是全局〜/ .gitconfig文件.

将'helper'值更改为通常位于文件末尾的值,如下所示:

[credential]
    helper = !'/cygdrive/C/Users/<YOUR-ACCOUNT-NAME>/AppData/Roaming/GitCredStore/git-credential-winstore.exe'
Run Code Online (Sandbox Code Playgroud)

为了解释,cygwin只使用不同的路径,值必须遵循规则.

  • 为我工作!但我正在使用最新的`git-credential-manager`和我的路径略有不同:`!'/ cygdrive/C/Users/<YOUR-ACCOUNT-NAME>/AppData/Local/Programs/Microsoft Git Credential Manager for在Windows /混帐凭据manager.exe'` (6认同)