Windows git: Fatal: TaskCanceledException encountered

后端 未结 8 628
渐次进展
渐次进展 2021-01-31 02:51

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

$ git pull --rebase
Fatal: TaskCanceledException enco         


        
相关标签:
8条回答
  • 2021-01-31 02:55

    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:

    git config --list --system

    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:

    git config --system --unset credential.helper

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

    0 讨论(0)
  • 2021-01-31 03:07

    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 manager while in global, it was set to wincred. You can check it using the below commands:

    git config --list --system

    git config --list --global

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

    git config --global credential.helper wincred

    0 讨论(0)
  • 2021-01-31 03:07

    This can also be triggered by a bad network connection. I sometimes have to switch to using my phone as a hotspot to stop Git giving the following error:

    fatal: TaskCanceledException encountered.
       A task was canceled.
    

    Perhaps it's an authentication timeout that triggers it?

    0 讨论(0)
  • 2021-01-31 03:11

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

    git config --system --unset credential.helper
    

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

    0 讨论(0)
  • 2021-01-31 03:15

    Turns out i had to to set up the proxy

    git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:80
    
    0 讨论(0)
  • 2021-01-31 03:16

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

    [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! :-)

    0 讨论(0)
提交回复
热议问题