Robert Claypool
Robert Claypool

Reputation: 4312

Git: dealing with remote branches from a removed remote

  1. git branch -a shows remotes/team/master and remotes/team/my-branch

  2. git remote rm team says "error: Could not remove config section 'remote.team'" (because I edited the config file with a text editor).

Since the team remote is gone, how can I delete these (local) remote branches?

Upvotes: 0

Views: 73

Answers (1)

Ikke
Ikke

Reputation: 101241

To delete remote tracking branches:

git branch -rd team/master 

-r means remote. So -rd means to delete remote tracking branches.

To automatically remote any remote tracking branches which don't have an upstream branch anymore:

git remote prune

Upvotes: 1

Related Questions