I\'ve a repository moodle on my Github account which I forked from the official repository.
I then cloned it on my local machine. It worked
It is possible the other branch you try to pull from is out of synch; so before adding and removing remote try to (if you are trying to pull from master)
git pull origin master
for me that simple call solved those error messages: