Subject: Remote reference deleted on git fetch

From: Peter van der Does <[email-masked]>
Date: Sat, 21 Nov 2015 10:24:20 -0500

Hi,

I have enabled fetch.prune and when I do a push of an existing branch
and fetch that branch the remote reference is deleted. Is this a bug or
expected behavior?

Doing the following commands on an existing repository:
$ git config fetch.prune true
$ git checkout -b bug/bug-1
Switched to a new branch 'bug/bug-1'
$ touch bugfix
$ git add .
$ git commit -a
$ git push --set-upstream origin bug/bug-1
Counting objects: 2, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 242 bytes | 0 bytes/s, done.
Total 2 (delta 1), reused 0 (delta 0)
To [email-masked]:petervanderdoes/Testing.git
 * [new branch]      bug/bug-1 -> bug/bug-1
Branch bug/bug-1 set up to track remote branch bug/bug-1 from origin.
$ git fetch origin bug/bug-1:refs/remotes/origin/bug/bug-1
>>From github.com:petervanderdoes/Testing
 x [deleted]         (none)     -> origin/bug/bug-1
$ git branch -r
  origin/master
$ git branch
* bug/bug-1
  master

The branch still exists on the remote repository.
Is it correct that the git fetch deletes the remote reference?

Peter

-- 
Peter van der Does

GPG key: CB317D6E

Site: http://avirtualhome.com
GitHub: https://github.com/petervanderdoes
Twitter: @petervanderdoes