On Tuesday, September 30, 2014 7:35:05 AM UTC+2, Sam Roberts wrote:
> Basically, I'd like to delete every branch in my fork of an upstream 
> repo that is the same as an upstream branch. 

Not sure if I understood correctly here. You want to delete all local 
branches which are already remote branches?

I don't understand why you want this though. Local branches that track 
remote branches are sort of just aliases for the remote branches. You don't 
save any space or anything by removing them all. Usually, you only create 
local branches manually when you want to work with a remote branch, or 
create one, and once the work is done, you manually delete it once it has 
been merged. If you have a lot of these merged branches lying around and 
you want to clean them up, there are scripts like (*use with caution, 
scripts may permanently delete important stuff*):

* https://github.com/arc90/git-sweep 
* http://mloughran.github.io/git-cleanup/  
* https://gist.github.com/Espenhh/3804251
* (google for more actively maintained alternatives)

In the case of a GitHub fork, I'm not sure what it does there on the 
serverside. Maybe it does a mirroring clone. Read more about this in the 
elaborate SO answer 

> With sufficient scripting, I can write something to enumerate and 
> compare branch heads, but I'm hoping someone knows of a tool that does 
> this, or can point me to some useful git plumbing to help. 
Have a look at the scripts above and see what they use. I'm guessing you'll 
find git fetch --prune helpful, as well as git branch --merged.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to