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

  • Home
  • SEARCH
  • 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 536611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:50:25+00:00 2026-05-13T09:50:25+00:00

Failed Attempts to Delete a Remote Branch: $ git branch -d remotes/origin/bugfix error: branch

  • 0

Failed Attempts to Delete a Remote Branch:

$ git branch -d remotes/origin/bugfix
error: branch 'remotes/origin/bugfix' not found.

$ git branch -d origin/bugfix
error: branch 'origin/bugfix' not found.

$ git branch -rd origin/bugfix
Deleted remote branch origin/bugfix (was 2a14ef7).

$ git push
Everything up-to-date

$ git pull
From github.com:gituser/gitproject

* [new branch] bugfix -> origin/bugfix
Already up-to-date.

How do I properly delete the remotes/origin/bugfix branch both locally and remotely?

  • 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-05-13T09:50:25+00:00Added an answer on May 13, 2026 at 9:50 am

    Executive Summary

    git push -d <remote_name> <branchname>
    git branch -d <branchname>
    

    Note: In most cases, <remote_name> will be origin.

    Delete Local Branch

    To delete the local branch, use one of the following:

    git branch -d <branch_name>
    git branch -D <branch_name>
    
    • The -d option is an alias for --delete, which only deletes the branch if it has already been fully merged in its upstream branch.
    • The -D option is an alias for --delete --force, which deletes the branch "irrespective of its merged status." [Source: man git-branch]
    • As of Git v2.3, git branch -d (delete) learned to honor the -f (force) flag.
    • You will receive an error if you try to delete the currently selected branch.

    Delete Remote Branch

    As of Git v1.7.0, you can delete a remote branch using

    $ git push <remote_name> --delete <branch_name>
    

    which might be easier to remember than

    $ git push <remote_name> :<branch_name>
    

    which was added in Git v1.5.0 "to delete a remote branch or a tag."

    Starting with Git v2.8.0, you can also use git push with the -d option as an alias for --delete. Therefore, the version of Git you have installed will dictate whether you need to use the easier or harder syntax.

    Delete Remote Branch [Original Answer from 5-Jan-2010]

    From Chapter 3 of Pro Git by Scott Chacon:

    Deleting Remote Branches

    Suppose you’re done with a remote branch — say, you and your collaborators are finished with a feature and have merged it into your remote’s main branch (or whatever branch your stable code-line is in). You can delete a remote branch using the rather obtuse syntax git push [remotename] :[branch]. If you want to delete your serverfix branch from the server, you run the following:

    $ git push origin :serverfix
    To git@github.com:schacon/simplegit.git
     - [deleted]         serverfix
    

    Boom. No more branches on your server. You may want to dog-ear this page, because you’ll need that command, and you’ll likely forget the syntax. A way to remember this command is by recalling the git push [remotename] [localbranch]:[remotebranch] syntax that we went over a bit earlier. If you leave off the [localbranch] portion, then you’re basically saying, “Take nothing on my side and make it be [remotebranch].”

    I ran git push origin :bugfix, and it worked beautifully. Scott Chacon was right—I will want to dog-ear that page (or virtually dog ear-by answering this on Stack Overflow).

    Finally, execute the following on other machines to propagate changes:

    # Fetch changes from all remotes and locally delete 
    # remote deleted branches/tags etc
    # --prune will do the job :-;
    git fetch --all --prune
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 348k
  • Answers 348k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer $value =~ /^[a-zA-Z0-9.]+$/ May 14, 2026 at 6:36 am
  • Editorial Team
    Editorial Team added an answer You ask for something that all ready exist on most… May 14, 2026 at 6:36 am
  • Editorial Team
    Editorial Team added an answer Are you running into cross-site-scripting restrictions? If it works in… May 14, 2026 at 6:36 am

Related Questions

I have a system which generates a cookie in PHP, then needs to delete
In a managed wrapper over a native library, I have to accomplish certain operations
I have an old server with a defunct evaluation version of SQL 2000 on
I've got a strange situation where deleting and creating directories in quick succession on
I'm trying to set up a Rails Template that would allow for comprehensive set-up

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.