git unable to update local ref

C++
git gc --prune=now
git remote prune origin
rm .git/refs/remotes/origin/master
git fetch
git pull origin master
Source

Also in C++: