On Friday, March 4, 2016 at 12:29:58 PM UTC+1, Konstantin Khomoutov wrote: > > > It depends. If you really want to wipe out any mentions of that branch, > the third command is necessary too: the way remote-tracking branches > work is somewhat asymmetrical to normal branches in that if a branch is > deleted in a remote repo you're tracking, the next `git fetch` against > that remote repo won't delete the matching remote-tracking branch. > So there are two ways to deal with such branches: one is that you > presented and another one is `git remote prune <remotename>` which > would reach for the identified remote repo, grab the list of branches > it has and make sure all your remote-tracking branches for that remote > which no longer exist there are deleted. >
I understand that the two commands do the same job with a substantial difference: git branch -dr origin/topic-branch can be used when there is only one remote-tracking branch to be deleted, while git remote prune <remotename> has to be used when there is more than one remote-tracking branch, unless I wanted to clean up the references one by one. I take for granted that your command should be used as git remote prune origin and not git remote prune origin/topic-branch, and that should be called after git branch -d topic-branch and git push origin --delete topic-branch. I also found git fetch --prune at stackoverflow <http://stackoverflow.com/questions/20106712/what-are-the-differences-between-git-remote-prune-git-prune-git-fetch-prune>probably to be used as git fetch origin --prune. -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
