Creating / pushing new branch in Azure Devops Repo

Prab's Avatar


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:

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)`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.

  3. Feodor Fitsner closed this discussion on 07 Apr, 2021 09:03 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? 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

Recent Discussions

27 Jan, 2023 08:06 PM
27 Jan, 2023 08:05 PM
25 Jan, 2023 03:23 PM
25 Jan, 2023 03:22 PM
23 Jan, 2023 03:29 PM