On Tuesday, September 30, 2014 8:49:11 PM UTC+2, Sam Roberts wrote:
> 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  


How about this approach:

(The thing is to avoid GitHub's Fork button, instead create it manually 
with only the branches you want)

* git clone github:joyent/node
* cd node
* git branch #one branch: master
* git remote add sam github:sam/node #where node is a freshly initialized 
GH repo
* git push sam master # pushes only one branch to your GitHub repo

Now you can clone the one-branch repo:
* git clone github:sam/node
* cd node
* git remote add joyent github:joyent/node
* git fetch joyent

Now you have your fork with just one branch in it. The branches from joyent 
are available in their remote, and I believe they will be updated with 
every `fetch joyent` that you make. Note that once you start creating 
tracking branches, you need update them manually or use a script (like 
git-up <https://github.com/aanand/git-up>). 

If you want to see all remote branches in your github repo, but not see the 
50 remote joyent branches, you can use

    git branch --list -a origin\* 

(might want to make an alias for it).

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