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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:04:13+00:00 2026-05-26T22:04:13+00:00

My normal pattern is to branch from master, do a ton of work, then

  • 0

My normal pattern is to branch from master, do a ton of work, then rebase and git svn dcommit. How can I clean up all my old branches?

Basically I want to find any branches that have git-svn-id: in the message and git branch -D those.

NOTE: git branch --no-color --no-track --merged gets me most of the way, but if I ever get into a situation where I need a git fetch -f (because of a crazy git-svn bug) I would have to go and rebase all the branches myself.

  • 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-26T22:04:13+00:00Added an answer on May 26, 2026 at 10:04 pm

    A sort-of-one-liner:

    git for-each-ref --format='%(refname:short)' refs/heads |
    while read branch; do
        if git show -s $branch | grep 'git-svn-id:'; then
            git branch -D $branch
        fi
    done
    

    Note that this is untested; I don’t use git-svn, and it’s just based on the requirements in the second paragraph of your question. You might try it first with an echo in there instead of git branch -D, to make sure the list of branches looks like what you’d expect. I can help refine it as necessary.

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

Sidebar

Related Questions

I use this pattern all over the place to grab data from the database
In normal mode I can hit Ctrl + E which deletes the rest of
The normal implementations of a work queue I have seen involve mutexes and condition
The normal process to load project from ccrc sever is create a Base view
I know UIBezierPath 's - (void)setLineDash:(const CGFloat *)pattern count:(NSInteger)count phase:(CGFloat)phase method can draw dashed
Consider a normal customer-orders application based on MVC pattern using WinForms. The view part
I have a quiz application. Which follows a normal pattern of database development Quiz
I'm using the JS prototype inheritance pattern from Gavin Kistner and I'm not quite
I am trying to understand the decorator pattern and from the examples I understand
I need button that has a replicated background pattern and normal button text on

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.