Luke
Luke

Reputation: 2340

Make git ask for credentials from the command-line

When git asks me for credentials, a dialog box appears. However, this doesn't work in PowerShell remote sessions. I have to open an RDP session on the computer.

How can I make git ask for credentials from the command-line?

Note: I don't want to store a clear password in some file nor type a clear password in the command-line.

Upvotes: 3

Views: 1847

Answers (2)

Antares
Antares

Reputation: 671

I think you are mistaken that git itself asks you for your credentials in a separate GUI window. git is a command line only program. However, there is the credentials subsystem which in turn may call/calls some external program to do its job.

You need to check your git configuration file to find out which program is invoked and change that setting. See the git doku on Credentials Storage for reference. Don't be fooled that this help is about the storing of passwords. The thing you need to look for is disabling the credentials helper (restoring the default behavior with no credentials helper) to get what you want.

Here is how to remove the helper:

git config --<system|global|local> --unset credential.helper

More about how to uninstall the credentials helper for windows.

Upvotes: 1

Luke
Luke

Reputation: 2340

Install the Git Credential Manager for Windows
This can also be done with Chocolatey:

choco install git-credential-manager-for-windows

Then configure the manager to ask the password from the command-line:

git config --<system|global|local> credential.modalPrompt false

However, according to this issue, it does not work remotely from the command line.

Upvotes: 2

Related Questions