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 263325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:35:32+00:00 2026-05-11T22:35:32+00:00

In my current repo I have the following output: $ git branch -a *

  • 0

In my current repo I have the following output:

$ git branch -a
* master
  remotes/origin/master
  remotes/public/master

I want to delete remotes/public/master from the branch list:

$ git branch -d remotes/public/master
error: branch 'remotes/public/master' not found.

Also, the output of git remote is strange, since it does not list public:

$ git remote show 
origin

How can I delete ‘remotes/public/master’ from the branch list?

Update, tried the git push command:

$ git push public :master
fatal: 'public' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
  • 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-11T22:35:32+00:00Added an answer on May 11, 2026 at 10:35 pm

    You might be needing a cleanup:

    git gc --prune=now
    

    or you might be needing a prune:

    git remote prune public
    

    prune

    Deletes all stale tracking branches under <name>. These stale branches have already been removed from the remote repository referenced by <name>, but are still locally available in “remotes/<name>”.

    With –dry-run option, report what branches will be pruned, but do no actually prune them.

    However, it appears these should have been cleaned up earlier with

    git remote rm public 
    

    rm

    Remove the remote named <name>. All remote tracking branches and configuration settings for the remote
    are removed.

    So it might be you hand-edited your config file and this did not occur, or you have privilege problems.

    Maybe run that again and see what happens.


    Advice Context

    If you take a look in the revision logs, you’ll note I suggested more “correct” techniques, which for whatever reason didn’t want to work on their repository.

    I suspected the OP had done something that left their tree in an inconsistent state that caused it to behave a bit strangely, and git gc was required to fix up the left behind cruft.

    Usually git branch -rd origin/badbranch is sufficient for nuking a local tracking branch , or git push origin :badbranch for nuking a remote branch, and usually you will never need to call git gc

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

Sidebar

Related Questions

I have a git repo and am having trouble reverting a merge. The current
We have currently just master branch. Our current workflow involves implementing the features locally,
i want to have the following git workflow, github / \ laptop-----desktop The idea
I have the following (here simplified) code which I want to test with FakeItEasy
Torvalds seems to have the following prompt . [torvalds@g5 git]$ The first word is
I am using git version 1.7.2.3 and I have the following situation: Clone git
I have the current controller code : public ActionResult BodyDay(int id, int year) {
I have done some stuff to my git repo and I think I am
I have the following mappings: public class SecurityMap : ClassMap<Security> { public SecurityMap() {
We currently have 2 branches: /repo/branch/current_version /repo/branch/next_version current_version is a branch where all developers

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.