Thanks for your help, folks, you had very detailed responses, but I
was not clear enough, I am well aware of the difference between local
and remote.

I want to delete *remote* branches in repo A that are also in *remote* repo B.

I guess you two don't use github, but if you fork a repo that has many
active branches, you get:

https://github.com/sam-github/node/branches/all

None of those branches are getting updated *in my remote*, not
automatically, they are just snapshots of the random set of branches
that existed in joyent/node.git at the instant a year and a half ago
when I forked it.

I would like to have only branches in my *remote* that I am working
on. github has partially realized the problem with this, and has
recently added the "Yours, Active, Stale" tabs to try to make sense of
the garbage branches that get copied over when you do a *github fork*,
but its insufficient, I use the command line most of the time, for
one.

If I ever want to checkout one of the branches from upstream (my name
for the remote joyent/node.git) I can always do it by checking out
upstream/v0.10.31-release, I don't need to have that branch in *my
remote*.

So what I want to do in effect is:

for each $branch in remote "origin",
  if head(origin/$branch) is in ancestry of upstream/$branch
    git push --delete origin $branch
  end
end

Like I said, I can script that, with some effort, but maybe someone
else has been annoyed by this?

And before you say, "who cares, disk space is cheap and the git object
store is efficient", I use `git branch -a` habitually to check for
origin branches that have not merged, its my work-list, but for my
local repo cloned from sam-github/node.git, it has 50+ branches, most
of which are not mine. I also use gitk to look at all my branches,
etc, I really don't want those dead branches in my remote.

-- 
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