简体   繁体   中英

How to download code from a particular branch in AzureDevOps release pipeline

I need to download all the files from the feature branch in AzureDevOps release pipeline. I am using Azure repo. Is there any task in AzureDevOps classic editor for the same? How to implement this using Powershell?

[UPDATE]

In your release pipeline,

  • if a previous step in the same job will check out the source repository but not check out the feature branch, you can use the git checkout command to check out the feature branch to the local repository on the agent machine, and this command also will switch the current branch to feature in the local repository.
git checkout -b feature --track origin/feature
  • if no previous step to check out any source version from the repository, you can use the git clone command to only check out the the feature branch to the local.
git clone <Repo_URL> -b feature

You can use either Bash or PowerShell to execute these commands in your pipeline.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM