Skip to contentSkip to conversation

Remote reference deleted on git fetch

DISCUSSION Peter van der Does 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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 protected]: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
Quoted 1 line

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

Signature · 7 lines
Peter van der Does

GPG key: CB317D6E

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