Dean Hiller
Dean Hiller

Reputation: 20210

git corrupted by someone not used to using git

I am not sure what this person keeps doing, but I keep getting into situations where my git pull (on master) fails like so

(base) Deans-MacBook-Pro:webpieces dean$ git pull
error: cannot update the ref 'refs/remotes/origin/victor/Delete_List_Copy': unable to append to '.git/logs/refs/remotes/origin/victor/Delete_List_Copy': Not a directory
From github.com:deanhiller/webpieces
 ! [new branch]          victor/Delete_List_Copy -> origin/victor/Delete_List_Copy  (unable to update local ref)

I run these commands which run just fine

I am not sure what he does exactly but eventually my git repo has this directory which I keep deleting (and which does not exist via git branch -r neither) ->

.git/refs/remotes/origin/victor/

I then run

  1. rmdir .git/refs/remotes/origin/victor/
  2. git pull

git pull fails with the first error in this SO post. The victor directory is back with a vengeance and I have no idea why.

Next, I try git remote prune origin

This does not help as git pull results in same error.

Over time, each repo seems to become corrupt on just git pull. I have no idea why this is occurring nor how to fix this repo resulting in yet another git clone to start over :(

Upvotes: 1

Views: 90

Answers (1)

jthill
jthill

Reputation: 60487

Your remote is behaving as if "victor" is serially making and deleting branches named victor and victor/whatever. Say git pull -p to get the fetch it runs to delete any stale refs first, that should prevent this kind of mismatch.

Upvotes: 1

Related Questions