Arthur Yakovlev Arthur Yakovlev - 1 year ago 346
Git Question

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

Help me pls. I am run this in terminal

asgard@asgard-A7N8X2-0:~/CollegePortal$ git pull
error: cannot open .git/FETCH_HEAD: Permission denied

Then I try this one

asgard@asgard-A7N8X2-0:~/CollegePortal$ sudo git pull
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

Help me, I don't understand this problem.

Thank you.

Answer Source

It seems like the first one isn't working because your user doesn't have the permissions for changing that directory, and the second because your root user doesn't have the right SSH keys for accessing that git repository.

Depending on what you're trying to do, it might be better to clone the repository to a different directory, or maybe chown the current directory to have full access for your user

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download