So imagine that I have a local repository that I've cloned from some origin. At the time of my intial clone, the origin had four branches: featureA, featureB, featureC and master. If I push changes to the origin that delete the featureA branch I'd expect to see something about it being deleted the next time I issue:
$ git pull origin
However, what happens is that I don't see anything and when I try to pull that specific branch down with
$ git pull origin featureA
I get the following error:
fatal: Couldn't find remote ref featureA
fatal: The remote end hung up unexpectedly
This totally makes sense, as the branch was in fact deleted from the remote so yeah, the ref is not there anymore however I'm wondering why I didn't get notified about this fact. My .git/config for the remote looks like this:
[remote "origin"]
fetch = +refs/heads/:refs/remotes/origin/
url = [email protected]:/data/git/perecep.git
I've written a small shell script that uses the git ls-remote along with the output from git branch -r to detect remote refs whose branches no longer exists on the server and prompt me if I would like to delete them but I'm wondering if I'm just doing something inherently wrong here?