Search code examples
windowsgitsshd

Using git in windows over sshd - stuck in push


In my environment, I cannot log in to the Windows GUI, but I have to use sshd to get a console (cmd.exe) from windows server 2019. Git is installed, but as soon as I try to do a git push, I face a problem:

Usually, in a CMD Console in Windows, a window with the credential manager would pop up, which doesn't work for this use case, where I actually "ssh-ed" via putty to a windows server. It seems that git gets stuck, obviously wanting to open a window.

How can I turn off this behavior, and make git on Windows more "unix-ish", so that like in a Linux environment the username/password prompt appears on the console?


Solution

  • Try and disable the credential helper (in your SSH session)

    git config credential.helper=
    

    That will allow you to test if Git is asking for credentials on the command line instead of opening a popup.
    Note that this is only if you are cloning HTTPS URL.

    Alternative option:

    cd path/to/repo
    git config --system --unset credential.helper
    git config --global --unset credential.helper
    git config --unset credential.helper