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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:58:01+00:00 2026-05-22T14:58:01+00:00

I have a bare public repo. The problem is that I’m already using it

  • 0

I have a bare public repo.

The problem is that I’m already using it for a long time and that means that there is a lot of junk in the bare repo. There are tons of dead branches, removed tags, etc…

Is there some command to cleanup the bare repo? Some like git remote prune that works for the opposite scenario?

Edit: Since there seems to be some confusion. This is my setup:

DevelMachine1
   ^
   |
   v
MainDevelRepo <-> MainRepo -> PublicBareRepo (with a lot of junk) -> The World
   ^
   |
   v
DevelMachine2
  • 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-22T14:58:02+00:00Added an answer on May 22, 2026 at 2:58 pm

    After even some more info:

    MainRepo -> PublicBareRepo (with a lot of junk) -> The World
    

    So the problem is here. Once in a while you do a push from MainRepo to PublicBareRepo, which now contains stuff that are no longer valid and shouldn’t be there. In the future, make sure that you only push up branches that should be there. I guess the main thing now is to remove branches from it, and then I have to step back to my original answer (assuming we are talking about the same kind of junk)

    git push PublicBareRepo :someBranch1
    git push PublicBareRepo :someBranch2
    

    After some more information from the OP:

    It seems it’s the repo design thats causing problems and a –mirror is the way to solve this. If A is the main bare repo that devs are pushing their stuff to, and if B is a public bare repo, then B should be a clone of A with the –mirror option.

    What needs to be done is to do “git remote update” (assuming B already is a mirror of A) on B so it will update itself to again be identical to A.


    Original answer:

    If you want to remove a branch on the remote repository you can do:

    git push origin :branchName
    

    The same goes for any ref really, e.g. for a tag:

    git push origin :tagName
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a bare git repo (lets call it repo #1) and cloned
I have been trying to write a bare-bones ping scanner using Perl for internal
I have made a bare repository (MY_LOCAL_REP) out of a public git repository hosted
Hi all and thanks for your time in advance. I have a problem trying
I have a bare git-svn repository and did a 'git svn fetch' on it.
I have a bare repository I access over a SMB network. Quite often I
I have a bare repository initialize on my webserver. I code on my workstation
I have a habit of keeping my variable usage to a bare minimum. So
Could I use migrator.net bare migration framework and just have a set of SQL
I have a simple ANTLR grammar, which I have stripped down to its bare

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.