How do I disable Git Credential Manager for Windows?

后端 未结 15 1747
被撕碎了的回忆
被撕碎了的回忆 2020-11-27 09:29

I notice that in the latest version of Git, the default is now to popup a \"Git Credential Manager for Windows\" dialog instead of prompting me for me password at the Bash p

相关标签:
15条回答
  • 2020-11-27 09:42

    you can just delete the Credential Manager.

    C:\Users\<USER>\AppData\Local\Programs\Git\mingw64\libexec\git-core
    
    0 讨论(0)
  • 2020-11-27 09:44

    Use:

    C:\Program Files\Git\mingw64\libexec\git-core                                                                       
    git credential-manager uninstall --force    
    

    This works on Windows systems. I tested it, and it worked for me.

    0 讨论(0)
  • 2020-11-27 09:44

    Maybe the problem is Sourcetree.

    1. Go to ToolsOptions

    2. Uncheck "Check default remotes for updates every [10] minutes"

    3. Restart Sourcetree!

    0 讨论(0)
  • 2020-11-27 09:47

    I struck the same issue on Ubuntu 18.10 (Cosmic Cuttlefish), unable to remove using any normal means. I used git config --global --unset credential.helper, and that seemed to do the trick.

    0 讨论(0)
  • 2020-11-27 09:48

    It didn't work for me:

    C:\Program Files\Git\mingw64\libexec\git-core
    git-credential-manager.exe uninstall
    
    Looking for Git installation(s)...
      C:\Program Files\Git
    
    Updated your /etc/gitconfig [git config --system]
    Updated your ~/.gitconfig [git config --global]
    
    Removing from 'C:\Program Files\Git'.
      removal failed. U_U
    
    Press any key to continue...
    

    But with the --force flag it worked:

    C:\Program Files\Git\mingw64\libexec\git-core
    git credential-manager uninstall --force
    08:21:42.537616 exec_cmd.c:236          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
    e
    08:21:42.538616 git.c:576               trace: exec: git-credential-manager uninstall --force
    08:21:42.538616 run-command.c:640       trace: run_command: git-credential-manager uninstall --force
    
    Looking for Git installation(s)...
      C:\Program Files\Git
    
    Updated your /etc/gitconfig [git config --system]
    Updated your ~/.gitconfig [git config --global]
    
    
    Success! Git Credential Manager for Windows was removed! ^_^
    
    Press any key to continue...
    

    I could see that trace after I run:

    set git_trace=1
    

    Also I added the Git username:

    git config --global credential.username myGitUsername
    

    Then:

    C:\Program Files\Git\mingw64\libexec\git-core
    git config --global credential.helper manager
    

    In the end I put in this command:

    git config --global credential.modalPrompt false
    

    I check if the SSH agent is running - open a Bash window to run this command

    eval "$(ssh-agent -s)"
    

    Then in the computer users/yourName folder where .ssh is, add a connection (still in Bash):

    ssh-add .ssh/id_rsa
    
    or
    
    ssh-add ~/.ssh/id_rsa(if you are not in that folder)
    

    I checked all the settings that I add above:

    C:\Program Files\Git\mingw64\libexec\git-core
    git config --list
    09:41:28.915183 exec_cmd.c:236          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-cor
    e
    09:41:28.917182 git.c:344               trace: built-in: git config --list
    09:41:28.918181 run-command.c:640       trace: run_command: unset GIT_PAGER_IN_USE; LESS=FRX LV=-c less
    core.symlinks=false
    core.autocrlf=true
    core.fscache=true
    color.diff=auto
    color.status=auto
    color.branch=auto
    color.interactive=true
    help.format=html
    rebase.autosquash=true
    http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
    http.sslbackend=openssl
    diff.astextplain.textconv=astextplain
    filter.lfs.clean=git-lfs clean -- %f
    filter.lfs.smudge=git-lfs smudge -- %f
    filter.lfs.process=git-lfs filter-process
    filter.lfs.required=true
    credential.helper=manager
    credential.modalprompt=false
    credential.username=myGitUsername
    

    And when I did git push again I had to add username and password only for the first time.

    git push
    Please enter your GitHub credentials for https://myGithubUsername@github.com/
    username: myGithubUsername
    password: *************
    Counting objects: 3, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (3/3), done.
    Writing objects: 100% (3/3), 316 bytes | 316.00 KiB/s, done.
    Total 3 (delta 2), reused 0 (delta 0)
    remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
    

    Since then using git push, I don't have the message to enter my Git credentials any more.

    D:\projects\react-redux\myProject (master -> origin) (budget@1.0.0)
    λ git push
    Counting objects: 3, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (3/3), done.
    Writing objects: 100% (3/3), 314 bytes | 314.00 KiB/s, done.
    Total 3 (delta 2), reused 0 (delta 0)
    remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
    To https://github.com/myGitUsername/myProject.git
       8d38b18..f442d74  master -> master
    

    After these settings I received an email too with the message:

     A personal access token (git: https://myGitHubUsername@github.com/
    on LAP0110 at 25-Jun-2018 09:22) with gist and repo scopes was recently added
    to your account. Visit https://github.com/settings/tokens for more information.
    
    0 讨论(0)
  • 2020-11-27 09:52

    Another option I had to use with VSTS:

    git config credential.modalprompt false --global

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