Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't push or pull to Github

Tags:

git

github

push

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.
like image 857
LeBlaireau Avatar asked Jul 20 '26 16:07

LeBlaireau


1 Answers

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.

like image 97
David K Avatar answered Jul 22 '26 07:07

David K



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!