Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Git push error on branch other than main

(0) ShareShare
ReportReport
Posted on by 12

i have a yaml pipeline which is working well when i am pushing my power app solution to git repo in the main But when i create a new branch(based on main) , say BranchABC. Is it failing with error.

I am trying to achieve a situation where each developer can checkin in their components in their own branches in Azure DevOps

On branch BranchABC
nothing to commit, working tree clean
fatal: 'BranchABC' does not appear to be a git repository
fatal: Could not read from remote repository.
fatal: could not read Username for <azure devops url> terminal prompts disabled
  • fannazephyr Profile Picture
    12 on at
    Re: Git push error on branch other than main

    then it is giving error: src refspec main does not match any - this error.

  • cchannon Profile Picture
    4,702 Super User 2025 Season 1 on at
    Re: Git push error on branch other than main

    Right. Try specifying the local branch as well as the target branch along the lines of:

     

    git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" push --set-upstream origin
    MainBranch:FeatureBranch
  • fannazephyr Profile Picture
    12 on at
    Re: Git push error on branch other than main

    i have these set of commands in yml. I have yml on my main branch and trying to push solution to custom FeatureBranch. It works if i run pipeline from FeatureBranch but not from main branch. 

    echo commit all changes
          git config user.email "<email>"
          git config user.name "<user name>"
          git checkout -B FeatureBranch
          git add --all
          git commit -m "solution init"
          echo push code to new repo
          git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" push --set-upstream origin
    FeatureBranch
  • fannazephyr Profile Picture
    12 on at
    Re: Git push error on branch other than main

    The idea is multiple developers can push their code in thier own branches in azure devops and then they will be merged for deployment

  • cchannon Profile Picture
    4,702 Super User 2025 Season 1 on at
    Re: Git push error on branch other than main

    What command are you running? have you tried specifying both the local branch name and the remote branch name to remove any ambiguity?

    git push origin {localBranchName}:{remoteBranchName}

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 72

Overall leaderboard