Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
340 views
in Technique[技术] by (71.8m points)

Error with Command Line Script in Azure DevOps Pipeline

I'm building my first pipeline using Power Platform Build Tools. I'm trying to export a Dynamics model driven app to a repo. I'm getting an error with in my Command Line Script. The following is the error log:

2021-01-21T08:48:04.6191345Z ##[section]Starting: Command Line Script
2021-01-21T08:48:04.6292483Z 
==============================================================================
2021-01-21T08:48:04.6292831Z Task         : Command line
2021-01-21T08:48:04.6293131Z Description  : Run a command line script using Bash on Linux and macOS 
and cmd.exe on Windows
2021-01-21T08:48:04.6293422Z Version      : 2.178.0
2021-01-21T08:48:04.6293630Z Author       : Microsoft Corporation
2021-01-21T08:48:04.6293952Z Help         : 
https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2021-01-21T08:48:04.6294293Z 
==============================================================================
2021-01-21T08:48:05.7216764Z error: pathspec 'master' did not match any file(s) known to git
2021-01-21T08:48:05.7217182Z Generating script.
2021-01-21T08:48:05.7217463Z ========================== Starting Command Output 
===========================
2021-01-21T08:48:05.7217952Z ##[command]"C:windowssystem32cmd.exe" /D /E:ON /V:OFF /S /C "CALL 
"D:a\_temp93c0ac5e-da28-4265-b4d0-4326b5f38209.cmd""
2021-01-21T08:48:05.7218457Z commit all changes
2021-01-21T08:48:05.7218642Z push code to new repo
2021-01-21T08:48:05.7226781Z fatal: pathspec '-' did not match any files
2021-01-21T08:48:05.7227220Z error: pathspec 'export"' did not match any file(s) known to git
2021-01-21T08:48:06.2395991Z git: 'bearer' is not a git command. See 'git --help'.
2021-01-21T08:48:06.2983259Z ##[error]Cmd.exe exited with code '1'.
2021-01-21T08:48:06.3323471Z ##[section]Finishing: Command Line Script

Based on this output, I don't know what is missing.

enter image description here

enter image description here

question from:https://stackoverflow.com/questions/65834862/error-with-command-line-script-in-azure-devops-pipeline

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

According to your screenshots, your default branch is "main", not "master".

enter image description here

The master did not match any branches known to git, so the task failed.

In addition, you need to use origin/{branch} instead of {branch}. As the branch is a remote branch.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...