Creating / pushing new branch in Azure Devops Repo

Prab's Avatar

Prab

05 Feb, 2021 06:03 PM

I'm trying to create and push a new branch on success, this link is specific to Github so not sure what the equivalent for my git repo in azure devops is supposed to be: https://www.appveyor.com/docs/how-to/git-push/

I've tried the following (see attached for full console) but the final git branch command still says I'm in the current (Github repo).
Set-Content -Path "$HOME\.git-credentials" -Value "https://$($env:access_token)@dev.azure.com/totaltestltd/Total%20Test/_git/AtataPoc/`n" -NoNewline

Note that this example is using two different repos, code that is cloned for the AppVeyor build is held in Github, and the final Git commands are aimed at a repo living in azure devops.

The ultimate scenario is where all the code lives in Azure Devops, so AppVeyor clones from there and then the aim would be to create a branch of that current build branch and push.

  1. 1 Posted by Prab on 05 Feb, 2021 06:51 PM

    Prab's Avatar

    Just to add an update, I've added some further commands such as cloning to a given dir, cd to that dir then trying to create a new branch and push. It fails on the final push with an authentication error.

  2. Support Staff 2 Posted by Feodor Fitsner on 05 Feb, 2021 07:09 PM

    Feodor Fitsner's Avatar

    I suggest to login into VM with RDP and troubleshoot it there to avoid accidential token leak into build log.

    While on RDP you can change credential helper to store and manually clone that repo in command line. Then check what's being saved in .git-credentials file.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • Console.PNG 263 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac