You can delete the remote-tracking branch using
git branch -d -r origin/<remote branch name>
as VonC mentions above. However, if you keep your local copy of the branch, git push
will still try to push that branch (which could give you a non-fast-forward error as it did for ruffin). This is because the config push.default
defaults to matching
which means:
matching - push all matching branches. All branches having the same name in both ends are considered to be matching. This is the default.
(see http://git-scm.com/docs/git-config under push.default
)
Seeing as this is probably not what you wanted when you deleted the remote-tracking branch, you can set push.default
to upstream
(or tracking
if you have git < 1.7.4.3)
upstream - push the current branch to its upstream branch.
using
git config push.default upstream
and git will stop trying to push branches that you have "stopped tracking."
Note: The simpler solution would be to just rename your local branch to something else. That would eliminate some potential for confusion, as well.