git/list[1] front-page[2] threads[3] people[4] search[5] about
 

How to get rid of tracking branch?

From
Johannes Sixt <j.sixt@eudaptics.com>
Date
Feb 14, 2007, 13:24 UTC
Message-ID
<45D30D8F.50261DB0@eudaptics.com>

Call me clueless, but how the heck do I get rid of a tracking remote branch? I've cloned a repo locally, but in the clone I don't want to track all the topic branches of the origin. But git branch -d keeps saying it doesn't find the remote branch:

$ git version
git version 1.5.0
$ git clone mingw-git/ mingw-git2
[... all looks fine ...]
$ cd mingw-git2/
$ git branch -a
* devel
  origin/HEAD
  origin/devel
  origin/master
  origin/origin
  origin/repo-devel
$ git branch -d origin/repo-devel
error: branch 'origin/repo-devel' not found.
$ git branch -d remotes/origin/repo-devel
error: branch 'remotes/origin/repo-devel' not found.
$ git branch -d heads/remotes/origin/repo-devel
error: branch 'heads/remotes/origin/repo-devel' not found.
$ git branch -d refs/heads/remotes/origin/repo-devel
error: branch 'refs/heads/remotes/origin/repo-devel' not found.
How do I delete remote branches? Do I have to
 rm .git/refs/heads/remotes/origin/repo-devel

(I know I have to update the config, too, so that the next pull doesn't draw the branch in again, but I haven't done that at this point.)

-- Hannes
Next: Andy Parkins
Message 1 of 3 in “How to get rid of tracking branch?”
  1. Johannes SixtFeb 14, 2007
  2. Andy ParkinsFeb 14, 2007
  3. Junio C HamanoFeb 14, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.