We switched from TFS to GIT. We are trying to update the submodule everytime we launch a new build.
We followed this guide : https://www.visualstudio.com/en-us/docs/build/scripts/git-commands#enable
We have an error at line 49.
We think that actually we need to authenticate. But we arent sure. We used : git pull and it works but when we do this : git submodule foreach git pull origin master. We have the message "Entering" and nothing happens
Did somebody already have this problem ? How did you solve it ?
Just found this Q/A with googling: You can use relative paths, ex:
the .gitmodules can contain:
Source
Have a nice day :)
It seems caused by the way VSTS build handle with git command with submodules.
I posted VSTS build hang up when execute git commands related to git submoudle, you can follow up the issue.
BTW, for the OAuth, you can add credential in
.gitmodules
.It is an authentication issue. You need to get the OAuth token into each of the submodule repos.
Make sure you have the build definition setting enabled to Allow scripts access to the OAuth token. As documented, this stuffs the token into a variable called System.AccessToken. It also stuffs the token into a git config setting that you'll see at the end of your get sources step when you run it after enabling the setting. This is how git authenticates to VSTS. You'll need to build a config statement for each of the repos, and you'll need to cd into that submodule to issue it in that repo.
Here is the Powershell script I used:
Then run a cmd or powershell step:
Lastly, you should clean up the token after you are done with it, so the OAuth doesn't hang out in your .git/config file on your build agent:
In your .gitmodules file you can try to add the organization name (case sensitive) in the url