Short Version
When a build pipeline is triggered, one of the build pipeline task will get the latest files and it has to be added/updated in the git
By default the source files are checked out to the Build.SourcesDirectory
(e.g : Directory: D:\a\1\s
), it can be considered as a temporary git repository.
According to the error message, it appears that the working directory of the command line task is not under the Build.SourcesDirectory
and you did't git checkout
again to that working directory.
So, please try unpack the solution zip file and store in Build.SourcesDirectory
, then run below Command line to push the commits (it works for me):
ECHO "Setting git config..."
git config --global user.email "xxx@xyz.com"
git config --global user.name "Admin"
ECHO "CHECK GIT STATUS..."
git status
git checkout -b master
ECHO "GIT ADD..."
git add -A
ECHO "CHECK GIT STATUS..."
git status
ECHO "Commiting the changes..."
git commit -m "Latest Customizations updated"
ECHO "Pushing the changes..."
git push -u origin master
ECHO "Customization Committed Successfully"
Please note that you need to Grant version control permissions to the build service and enable Allow scripts to access the system token.