Reputation: 17467
When I try and pull:
error: cannot open .git/FETCH_HEAD: Permission denied
When I try a push or a push -u origin master
:
master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:xxxxxxxx/xxxxxxxxxx.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again. See the 'Note about
-forwards' section of 'git push --help' for details.
Upvotes: 2
Views: 9482
Reputation: 690
Reading through the "man git-push" they mention a "git pull" should be enough to resolve this, but since you're getting "error: cannot open .git/FETCH_HEAD: Permission denied" did you perhaps create the clone of the branch using sudo ? If so your files may not be readable by your user. Double check that the file .git/FETCH_HEAD is readable by your user account.
Upvotes: 7
Reputation: 364
Your local copy might not be in-sync with the remote hub.
Here is a good guideline when pulling/pushing from/to github repo:
Upvotes: 3