Dav*_*edy 249 git msysgit git-config git-bash
我按照这些说明来写信,包括有关密码缓存的部分.似乎说明是错误的,因为每次git push origin master我收到此错误:
git: 'credential-cache' is not a git command. See 'get --help'.
Run Code Online (Sandbox Code Playgroud)
...此时我被迫输入我的用户名和密码.这样做之后,我再次收到相同的错误消息,然后是输出git push.
这是我的.gitconfig文件的内容:
[user]
name = myusername
email = myusername@myemaildomain.com
[credential]
helper = cache
Run Code Online (Sandbox Code Playgroud)
要清楚,在我安装Git并运行Git Bash之后,这就是我输入的内容:
git config --global user.name "myusername"
git config --global user.email "myusername@myemaildomain.com"
git config --global credential.helper cache
Run Code Online (Sandbox Code Playgroud)
请帮忙.这太令人沮丧了!
Nat*_*ook 313
从我发现的博客:
"这个[git-credential-cache]不适用于Windows系统,因为git-credential-cache通过Unix套接字进行通信."
由于msysgit已被Git for Windows取代,因此使用Git for Windows现在是最简单的选择.某些版本的Git for Windows安装程序(例如2.7.4)在安装期间有一个复选框以启用Git Credential Manager.这是一个截图:
将wincred在msysgit 1.8.1加入帮手.使用方法如下:
git config --global credential.helper wincred
Run Code Online (Sandbox Code Playgroud)
首先,下载git-credential-winstore并将其安装在您的git bin目录中.
接下来,确保包含git.cmd的目录位于Path环境变量中.其默认目录是64位系统上的C:\ Program Files(x86)\ Git\cmd或32位系统上的C:\ Program Files\Git\cmd.测试这个的简单方法是启动命令提示符并键入git.如果你没有得到git命令列表,那么它没有正确设置.
最后,启动命令提示符并键入:
git config --global credential.helper winstore
Run Code Online (Sandbox Code Playgroud)
或者您可以手动编辑.gitconfig文件:
[credential]
helper = winstore
Run Code Online (Sandbox Code Playgroud)
完成此操作后,您可以通过Windows Credential Manager管理您的git凭据,您可以通过Windows控制面板进行管理.
A T*_*A T 56
看起来git现在wincred在Windows上开箱即用(msysgit):
git config --global credential.helper wincred
Run Code Online (Sandbox Code Playgroud)
参考:https: //github.com/msysgit/git/commit/e2770979fec968a25ac21e34f9082bc17a71a780
Iva*_*ael 26
第一次运行 git config --global credential.helper wincred
然后去: CONTROL PANEL\CREDENTIAL MANAGER\WINDOWS CREDENTIAL\GENERIC CREDENTIAL
然后点击添加凭据Internet or network address:
添加git:https://{username}.github.com
User: {名称}
Password: {密码}
Ikr*_*rom 20
我在windows7上使用AptanaStudio3时遇到了这个问题.这对我有所帮助:
git config --global credential.helper wincred
Run Code Online (Sandbox Code Playgroud)
代码来自这里
Sah*_*eed 10
现在,通过双击Windows上的小exe,可以更轻松地设置Git密码缓存.git-credential-winstore尽管该项目已从GitHub转移到http://gitcredentialstore.codeplex.com/,但该程序仍然基于最高投票答案.
您可以从以下博客文章下载exe(以及Mac的二进制文件):https://github.com/blog/1104-credential-caching-for-wrist-friendly-git-usage
Pin*_*yni 10
我通过credential从特定项目的配置中删除该部分来解决此问题:
git config -e[credential] helper = cache。这删除了烦人的消息:
git: 'credential-cache' is not a git command. See 'git --help'.
类似的错误是 'credential-wincred' is not a git command
wincred适用于不再维护的项目git-credential-winstore 。它由Microsoft开源维护的Windows的Git-Credential-Manager-for Windows取代。
从上面的链接下载该版本作为zip文件并将内容提取到
\cygwin\usr\libexec\git-core
Run Code Online (Sandbox Code Playgroud)
(或者\cygwin64\usr\libexec\git-core可能是)
然后启用它(通过设置global .gitconfig)-执行:
git config --global credential.helper manager
Run Code Online (Sandbox Code Playgroud)
如何使用
无需进一步的配置。
当需要凭据时,它可以自动运行。
例如,当推送到Azure DevOps时,它将打开一个窗口并初始化oauth2流以获取令牌。
参考:
https://github.com/Microsoft/Git-Credential-Manager-for-Windows#installation-in-an-msys2-environment
当我尝试从 master 分支使用命令“git pull”时,我也遇到了类似的错误。
Error: "git: 'credential-manager' is not a git command. See 'git --help'."
Run Code Online (Sandbox Code Playgroud)
我执行了以下两个命令,问题得到解决。
$ git config --global --unset credential.helper
$ git config credential.helper store
Run Code Online (Sandbox Code Playgroud)
首先找到您用于GIT的版本.
使用此命令:git --version
如果你有一个比1.7.10更新的版本.
然后只需使用此命令即可.
git config --global credential.helper wincred
Run Code Online (Sandbox Code Playgroud)
为了解决这个问题的其他人,我在Ubuntu中遇到了同样的问题(即我的密码没有缓存,尽管已正确设置选项并得到错误git: 'credential-cache' is not a git command.),直到我发现此功能仅为在Git 1.7.9及以上版本中可用.
在Ubuntu(Natty;我是一个顽固的Gnome 2用户)的旧版本中,repo中的版本是git版本1.7.4.1.我使用以下PPA进行升级:https: //launchpad.net/~git-core/+archive/ppa
| 归档时间: |
|
| 查看次数: |
119399 次 |
| 最近记录: |