user989988
user989988

Reputation: 3746

Update git submodules

On trying to update git submodule, I see the following error:

Submodule 'paa' (https://github.com/microsoftgraph/paa.git) registered for path 'paa'
Cloning into 'D:/a/1/s/paa'...
git: 'credential-manager-core' is not a git command. See 'git --help'.
fatal: could not read Username for 'https://github.com': terminal prompts disabled
fatal: clone of 'https://github.com/microsoftgraph/paa.git' into submodule path 'D:/a/1/s/paa' failed
Failed to clone 'paa'. Retry scheduled
Cloning into 'D:/a/1/s/paa'...
git: 'credential-manager-core' is not a git command. See 'git --help'.
fatal: could not read Username for 'https://github.com': terminal prompts disabled
fatal: clone of 'https://github.com/microsoftgraph/paa.git' into submodule path 'D:/a/1/s/paa' failed
Failed to clone 'paa' a second time, aborting
##[error]Git submodule update failed with exit code: 1

I referenced Fatal Error when updating submodule using GIT stack overflow post and .gitmodules already has the following content:

[submodule "paa"]
    path = paa
    url = https://github.com/microsoftgraph/paa.git

UPDATE:

Based on below answer I added a PATH as follows:

C:\Program Files\Git\bin
C:\Program Files\Git\cmd
C:\Program Files\Git\usr\bin
C:\Program Files\Git\mingw64\bin
C:\Program Files\Git\mingw64\libexec\git-core

I still see the same error. I tried updating the content in .gitmodules to the following:

[submodule "paa"]
    path = paa
    url = https://<username>:<password>@github.com/microsoftgraph/paa.git

I see this error:

Submodule 'paa' (https://<username>:<password>@github.com/microsoftgraph/paa.git) registered for path 'paa'
Cloning into 'D:/a/1/s/paa'...
fatal: unable to access 'https://<username>:<password>@github.com/microsoftgraph/paa.git/': Could not resolve host: <username>:<password>@github.com
fatal: clone of 'https://<username>:<password>@github.com/microsoftgraph/paa.git' into submodule path 'D:/a/1/s/paa' failed

Upvotes: 1

Views: 743

Answers (1)

VonC
VonC

Reputation: 1328552

For all my recent (2.29) Windows Git installations, I had to add %GH%\mingw64\libexec\git-core to my PATH (GH is the path where Git is installed).
See VonC/setupsenv commit f1a1dcd as an example:

set PATH=%GH%\bin;%GH%\cmd;%GH%\usr\bin;
set PATH=%GH%\mingw64\bin;%GH%\mingw64\libexec\git-core;%PATH%
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

That way, the GCM (Microsoft Git-Credential-Manager-Core becomes available and the error message is no more.

Upvotes: 2

Related Questions