<sigh> OK, I found it....

git push remote :branch-name

will delete the remote branch.   Sooooo intuitive....

On Fri, Mar 2, 2012 at 9:44 AM, Phillip Moore <[email protected]> wrote:
> Perhaps one of you knows how to do this....
>
> We have accumulated a lot of stale tracking branches and I wanted to
> clean them up, but they simply will not go away.   Finding an
> explanation for how do this hasn't yielded any helpful results, but
> posts by other people who also have no clue what they are doing,
> guessing which commands to run, and making a bigger mess of things.
>
> Here's what I see:
>
> pmoore@Renegade$ git remote show origin
> * remote origin
>  Fetch URL: [email protected]:efs-core.git
>  Push  URL: [email protected]:efs-core.git
>  HEAD branch (remote HEAD is ambiguous, may be one of the following):
>    backup-database
>    master
>  Remote branches:
>    aix-support             tracked
>    backup-database         tracked
>    curl2lwp                tracked
>    gssapi-optional         tracked
>    kill_class_std          tracked
>    master                  tracked
>    moose                   tracked
>    nfs-noac                tracked
>    openafs                 tracked
>    package-fix             tracked
>    standalone              tracked
>    tt159_critic_fixins     tracked
>    tt68_try_tiny           tracked
>    upload-download-aliases tracked
>  Local branches configured for 'git pull':
>    master      merges with remote master
>    package-fix merges with remote package-fix
>    standalone  merges with remote standalone
>  Local refs configured for 'git push':
>    master      pushes to master      (up to date)
>    openafs     pushes to openafs     (up to date)
>    package-fix pushes to package-fix (up to date)
>    standalone  pushes to standalone  (up to date)
>
> (NOTE: The ambiguous HEAD concerns me to, but one thing at a time).
>
> According to the git-branch man page, this removes a remote branch:
>
> pmoore@Renegade$ git branch -d -r origin/aix-support
> Deleted remote branch origin/aix-support (was 7f5218f).
>
> But this seems to just delete a *local* reference to the remote branch.   
> Note:
>
> pmoore@Renegade$ git remote show origin | grep aix
>    aix-support             new (next fetch will store in remotes/origin)
>
> And then:
>
> pmoore@Renegade$ git pull
> From git.openefs.org:efs-core
>  * [new branch]      aix-support -> origin/aix-support
> Already up-to-date.
>
> It comes back!!!   Now, if you recall the incredibly non-intuitive way
> that we created these branches, maybe that provides a clue.
>
> pmoore@Renegade$ git push origin origin:refs/heads/new-branch
> Total 0 (delta 0), reused 0 (delta 0)
> remote: No commit email for refname refs/heads/new-branch
> remote: No html exported for refname refs/heads/new-branch
> remote: No archives exported or repo efs-core
> To [email protected]:efs-core.git
>  * [new branch]      origin/HEAD -> new-branch
> pmoore@Renegade$ git branch --track new-branch origin/new-branch
> Branch new-branch set up to track remote branch new-branch from origin.
>
> That "git push origin" syntax is maximally confusing.   It seems that
> all the git branch commands work against LOCAL configuration
> information, and they don't really change the remote repository.   So,
> it's clear how to delete the LOCAL references to a remote tracking
> branch, but how the hell do you delete the actual tracking branch in
> the remote repository?
>
> I must have looked at 20+ git help related pages, and can find nothing
> about how to do this.  I'll keep looking, but if anyone has a clue how
> to do this, or finds the answer, please share it.
_______________________________________________
EFS-dev mailing list
[email protected]
http://mailman.openefs.org/mailman/listinfo/efs-dev

Reply via email to