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

git fetch origin --tags --prune deletes origin/master?

From
SFSteve Folly <steve@spfweb.co.uk>
Date
Aug 13, 2010, 08:36 UTC
Message-ID
<loom.20100813T102636-936@post.gmane.org>
Hi,
Using git 1.7.2.1...

Doing "git fetch origin --tags --prune" deletes my local ref of origin/master? Is this right? The remote is not affected. To reproduce:

$ cd /tmp &&
    git init --bare remote.git &&
    git clone remote.git local &&
    cd local &&
    touch file &&
    git stage file &&
    git commit -m "add file"
    git push origin master
$ git branch -a
* master
  remotes/origin/master
$ git fetch origin --tags --prune
 x [deleted]         (none)     -> origin/master
$ git branch -a
* master
$ git fetch 
From /tmp/remote
 * [new branch]      master     -> origin/master
$ git branch -a
* master
  remotes/origin/master
Am I just not understanding something or is this a bug?

Cheers, Steve

Message 1 of 1 in “git fetch origin --tags --prune deletes origin/master?”
  1. Steve FollyAug 13, 2010

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.