Cedric Arnould
Cedric Arnould

Reputation: 2393

Push git current branch to a remote git in Azure Pipeline

Using old fashion way in Azure Dev Ops to create pipeline, I'm looking for a solution to push the git current branch to a remote git. This is really not conventional I know, but if it's done automatically, I have to do it manually and I'm not good to remember things. Moreover, I like to resolve new challenge.

Here is what I have currently: enter image description here

And the script executed is:

git remote add EXT [email protected]:v3/EXT/EXT-Project/ext-web-app
git fetch
git push origin HEAD:master --force
git branch -f develop origin/develop
git pull EXT develop

What I noticed is when the Command Line task starts:

Question:

Note: I don't need to handle the merge conflict with the external git branch, if it happens, the pipeline failed and that's it (it's not supposed to happen btw)

Upvotes: 1

Views: 1103

Answers (1)

VonC
VonC

Reputation: 1324063

You could use the Install SSH Key task, as seen in "Checkout git submodule in Azure Pipeline with SSH", in order to force the pipeline to use your private/public key.

Make sure you have the right to access the EXT/EXT-Project, meaning the public key which will authenticate you must refer to an account authorized to read EXT/EXT-Project.

Upvotes: 2

Related Questions