azure-pipelines-agent: Using Git submodules doesn't work with private repository

Agent version and platform

2.105.5 Windows

VSTS type and version

Team Services

What’s not working?

Git submodules are not working when using GitHub private repositories.

Agent and Worker’s diag log

******************************************************************************
Starting: Build
******************************************************************************
Current agent version: '2.105.5'
******************************************************************************
Starting: Get Sources
******************************************************************************
Syncing repository: user666/MyRepo (GitHub)
Prepending Path environment variable with directory containing 'git.exe'.
git version
git config --get remote.origin.url
git clean -fdx
git reset --hard HEAD
HEAD is now at cb830b0 Fix merge
git submodule foreach git clean -fdx
git submodule foreach git reset --hard HEAD
git config gc.auto 0
git config --get-all http.https://github.com/user666/MyRepo.git.extraheader
git remote set-url origin https://********:********@github.com/user666/MyRepo.git
git remote set-url --push origin https://********:********@github.com/user666/MyRepo.git
git fetch --tags --prune --progress origin
git checkout --progress --force cb830b0c893e1fc47c401f198b0ccd51419b96b4
HEAD is now at cb830b0... Fix merge
git submodule init
git submodule update -f
Cloning into 'C:/agent/_work/2/s/Core'...
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': Invalid argument
fatal: clone of 'https://github.com/user666/MyRepoCore.git' into submodule path 'C:/agent/_work/2/s/Core' failed
Git submodule update failed with exit code: 1

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18 (7 by maintainers)

Most upvoted comments

Worked. Thank you very much!

For others that might come across the same issue.

.gitmodules looks like this now

[submodule "themes/my-hugo-future-imperfect"]
    path = themes/my-hugo-future-imperfect
    url = ../my-hugo-future-imperfect.git

I just edited the file.

@martingust what do you mean you added the app to your submodules? I’m facing a similar problem and I’m stuck here.

[EDIT] Nevermind - I just didn’t know how to set the relative path to my submodule repositories. I had to change the url in the .gitmodules file to url = ../submodulerepositoryname

Current workaround: Install latest Git on Windows agent. Set system.prefergitfrompath to true in build definition variables.