Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8460389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:35:37+00:00 2026-06-10T13:35:37+00:00

I cannot remove a remote branch called origin/featureBranch . I guess it’s because the

  • 0

I cannot remove a remote branch called origin/featureBranch. I guess it’s because the branch name starts with origin, but I am not sure:

$ git branch -r | grep featureBranch
  origin/origin/featureBranch

$ git push origin :origin/featureBranch

    error: unable to push to unqualified destination: origin/featureBranch

    The destination refspec neither matches an existing ref on the remote nor
    begins with refs/, and we are unable to guess a prefix based on the source ref.

    error: failed to push some refs to 'git@github.com:myCompany/my-repo.git'

UPDATE

$ git push origin :featureBranch gives the same error.

NOTE

In remote branch is origin/origin/myFeature, locally it is origin/myFeature.

I know what origin usually means, but in my case – this is part of name of the branch.

Github does not see this branch.


Could please anyone explain me what happens “behind the scene” and how can I remove this branch?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:35:39+00:00Added an answer on June 10, 2026 at 1:35 pm

    Try this:

    git push origin :refs/heads/origin/featureBranch
    

    You can always reference branches by their technical name under refs/heads/.

    A branch is stored as a small text file under .git/refs/. Local branches go under .git/refs/heads/, and remote branches under .git/refs/remotes/<remotename>/. A simple branch like master will thus be found at .git/refs/heads/master and .git/refs/remotes/origin/master, but your buggy branch will actually reside under .git/refs/heads/origin/featureBranch. It will not be confused with a remote branch on the origin repository because it’s not under refs/remotes/origin/, but under refs/heads/.

    On the remote server, the origin/featureBranch branch is local to the server, so it will be stored under refs/heads/. When pushing to a given branch, you can identify it either by its name, or by its path, so if a name doesn’t work, just use the full path starting with refs.

    How you ended up with this weird branch name? I can’t tell for sure, since I don’t know what you did, but I encountered the same problem when I used git push --mirror, which pushes all the references, including remote ones, so it will create an origin/branchname as a local branch.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not sure how I've managed this but I can't create a local and remote
I got this crash report from a remote user, but I cannot find any
The command $ make all gives errors such as rm: cannot remove '.lambda': No
I'd like to remove the popup message 'Sorry this video cannot be played' from
I am trying to remove all HTML elements from a String. Unfortunately, I cannot
I'm sure this is very simple to do, but I have followed a number
I cannot remove padding adjacent to a link in this page I have reduced
This CSS problem is killing me :-( I cannot remove padding under a link
According to GitGuys Remote Tracking Branches should not be modified by users (don’t set
I actually want to remove a branch in the bare repository i am working

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.