tag:help.appveyor.com,2012-11-13:/discussions/problems/28943-creating-pushing-new-branch-in-azure-devops-repoAppVeyor: Discussion 2021-04-07T21:03:42Ztag:help.appveyor.com,2012-11-13:Comment/490178432021-02-05T18:03:11Z2021-02-05T18:03:13ZCreating / pushing new branch in Azure Devops Repo<div><p>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: <a href="https://www.appveyor.com/docs/how-to/git-push/">https://www.appveyor.com/docs/how-to/git-push/</a></p>
<p>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).<br>
Set-Content -Path "$HOME.git-credentials" -Value "https://$($env:access_token)@dev.azure.com/totaltestltd/Total%20Test/_git/AtataPoc/`n" -NoNewline</p>
<p>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.</p>
<p>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.</p></div>Prabtag:help.appveyor.com,2012-11-13:Comment/490178432021-02-05T18:51:32Z2021-02-05T18:51:33ZCreating / pushing new branch in Azure Devops Repo<div><p>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.</p></div>Prabtag:help.appveyor.com,2012-11-13:Comment/490178432021-02-05T19:09:02Z2021-02-05T19:09:02ZCreating / pushing new branch in Azure Devops Repo<div><p>I suggest to login into VM with <a href="https://www.appveyor.com/docs/how-to/rdp-to-build-worker/">RDP</a> and troubleshoot it there to avoid accidential token leak into build log.</p>
<p>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 <code>.git-credentials</code> file.</p></div>Feodor Fitsner