git pull error :error: remote ref is at but expected


Full message:

error: Ref refs/remotes/origin/user is at 3636498c2ea7735fdcedc9af5ab3c8689e6abe77 but expected a21359c6cc2097c85775cde6a40105f4bd7100ec
From{github project url}
 ! a21359c..6273ffc  user -> origin/user  (unable to update local ref)


If you are running git under a file system that is not case sensitive (Windows or OS X) this will occur if there are two branches with the same name but different capitalisation, e.g. user_model_changes and User_model_changes as both of the remote branches will match the same tracking ref.

Delete the wrong remote branch (you shouldn't have branches that differ only by case) and then git remote prune origin and everything should work

Trying to git pull with error: cannot open .git/FETCH_HEAD: Permission denied

How can I delete a remote tag?