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

Re: Git Strange behaviour with remote deleted branch

From
Paul Smith <paul@mad-scientist.net>
Date
Jun 19, 2017, 21:46 UTC
Message-ID
<1497908782.6463.8.camel@mad-scientist.net>
In-Reply-To
<39331ce5-dbf9-170e-e550-784db10b966f@gmail.com>
On Mon, 2017-06-19 at 23:33 +0200, Reda Lyazidi wrote:
Show 8 quoted lines
> with git I noticed when I removed a remote branch with git push origin 
> --delete <the branch>
> in my clone when I used git branch -a I don't the deleted branch
> but my colleagues still see it.
> 
> I tried with two clones in my PC, with the first one delete branch and 
> the other still sees it
> despite git pull .

Normally Git will not remove a remote's branch refs on a fetch (or pull) operation. This is a safety measure, since you might still have a use for that branch (for example to run diff against or similar).

In order to remove branches that have been deleted in your remote, you must use the --prune (or -p) option to git fetch or git pull:

  git pull -p
will get rid of them.
Previous: Reda LyazidiNext: Jeff King
Message 2 of 3 in “Git Strange behaviour with remote deleted branch”
  1. Reda LyazidiJun 19, 2017
  2. Paul SmithJun 19, 2017
  3. Jeff KingJun 20, 2017

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.