I am working on an Azure pipeline for a dotnet core project that runs on Windows Self hosted agent. I want my pipeline to use Git commands to check out the release branch and merge the develop branch into it. Next steps will be to build the release branch and deploy to intranet servers
I don’t know Git wording very good, I was using TFS for years. I use the commands below and got the logs here:
- task: CmdLine@2
displayName: Checkout Release branch
inputs:
script: |
@echo off
git checkout release
git pull develop
git status
From the logs, I understand:
- It downloads the content of the develop branch because it is the default branch in GitHub, I’d rather want the release branch but I believe Azure is like that
- I manage to switch to release but I have these errors that I don’t understand: ##[error]Previous HEAD position was bc94bd2 Update Staging Build Pipeline.yml ##[error]Switched to branch 'release'
- I understood that pull can be used with local or remote branch so I use it to fetch and merge the develop branch to the release branch but I get: [error]fatal: 'develop' does not appear to be a git repository
- Do I have to specify credentials on every calls to git?
- On the last step, it fetches again the code from the develop branch and I understand why
If you could help me improve my script, that would be great, Many thanks.


release) from a repo. Is this correct?