Windows git:致命:遇到 TaskCanceledException

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36309363/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 11:54:13  来源:igfitidea点击:

Windows git: Fatal: TaskCanceledException encountered

git

提问by Notinlist

I have recently updated my git (2.7.4.windows.1). Since then pulling from github produces output like this:

我最近更新了我的 git (2.7.4.windows.1)。从那时起,从 github 中提取会产生如下输出:

$ git pull --rebase
Fatal: TaskCanceledException encountered.
Current branch ABC-123_Something is up to date.

The Fatal: TaskCanceledException encountered.appears after a boring 20 seconds and then everything works out just fine. I haven't found anything on the net and I would like to avoid wasting that 20 seconds over and over again.

Fatal: TaskCanceledException encountered.一个无聊的20秒,然后一切后出现就很好了。我没有在网上找到任何东西,我想避免一遍又一遍地浪费那 20 秒。

采纳答案by Notinlist

The credential helper handling changed since the last version that I used. The systemwide gitconfig(as TortoiseGit calls it) contained a section:

自我使用的上一个版本以来,凭证助手处理发生了变化。该系统范围gitconfig(如TortoiseGit调用它)包含一个部分:

[credential]
    helper = manager

I think it is some leftover from previous versions. I deleted it and the delay and the error message haven't happened since. Victory! :-)

我认为这是以前版本的一些剩余部分。我删除了它,从那以后没有发生延迟和错误消息。胜利!:-)

回答by jgode

I just ran into this same problem and, in case it is missed in the comments for the accepted answer, the fix is:

我刚刚遇到了同样的问题,如果在已接受答案的评论中遗漏了它,解决方法是:

git config --global credential.helper wincred

Credit to Hugo Allexis Cardona

感谢雨果Allexis卡多纳

回答by Piotrek

None of the above helped me... So my fix is to remove managerhelper from git's system config:

以上都没有帮助我......所以我的解决方法是从git的系统配置中删除经理助手:

git config --system --unset credential.helper

If you got permission denied, invoke above command after running cmd as administrator.

如果您获得了权限被拒绝,请在以管理员身份运行 cmd 后调用上述命令。

回答by Artif3x

There appears to be some relation between the setting of proxy options inside your global .gitconfig file and the need to clear your credential helper setting from the system level. I recently removed git http-proxy and https-proxy settings from my file for security reasons, and began receiving this message, then a pause, then a prompt to log into my external git repository. This happened with every fetch, push or pull. I didn't want to replace the proxy settings in my .gitconfig, so here are the steps that worked for me:

全局 .gitconfig 文件中的代理选项设置与需要从系统级别清除凭据帮助程序设置之间似乎存在某种关系。出于安全原因,我最近从我的文件中删除了 git http-proxy 和 https-proxy 设置,并开始收到此消息,然后暂停,然后提示登录我的外部 git 存储库。每次取、推或拉都会发生这种情况。我不想替换 .gitconfig 中的代理设置,因此以下是对我有用的步骤:

git config --list --system

git config --list --system

git config --list --global

git config --list --global

These will give you listings of all your system and global level settings. This confirmed that it was set to credential.helper=manager in the system namespace, and credential.helper=wincred in the global namespace. To remove the interference on the system level:

这些将为您提供所有系统和全局级别设置的列表。这确认它在系统命名空间中设置为 credential.helper=manager,在全局命名空间中设置为 credential.helper=wincred。消除系统层面的干扰:

git config --system --unset credential.helper

git config --system --unset credential.helper

All git command reverted to normal, with no error messages or delays.

所有 git 命令恢复正常,没有错误消息或延迟。

回答by SONU SOURAV

This happens because there is a clash of git .config settings in the global and system level. In my case, the credential helper in system was set to managerwhile in global, it was set to wincred. You can check it using the below commands:

发生这种情况是因为 git .config 设置在全局和系统级别存在冲突。就我而言,系统中的凭证助手设置为,manager而在全局中,它设置为wincred. 您可以使用以下命令进行检查:

git config --list --system

git config --list --system

git config --list --global

git config --list --global

I changed the system one from manager to wincredand it worked. Change it using the below command.

我将系统一从经理更改为wincred,它起作用了。使用以下命令更改它。

git config --global credential.helper wincred

git config --global credential.helper wincred

回答by gaborous

This error can also happen when your Git hoster is down, so check the status page (eg, GitHub status) to see if there is any incident on the hoster side before trying the other solutions here.

当您的 Git 主机关闭时也可能发生此错误,因此在尝试此处的其他解决方案之前,请检查状态页面(例如,GitHub status)以查看主机端是否有任何事件。

回答by Xolani

Turns out i had to to set up the proxy

结果我不得不设置代理

git config --global http.proxy http://proxyuser:[email protected]:80