Git (Version Control) - Resolve "error: cannot open .git/FETCH_HEAD: Permission denied"

Let's say the following is being returned when issuing the git pull command.

error: cannot open .git/FETCH_HEAD: Permission denied

 

Typically this means you do not have permission to the hidden .git directory (on a Linux system). In this example, user john.doe lacks permission to the hidden .git directory. This can be resolved by either switching to a user that has permission to the hidden .git directory (root in this example) or using the chmod (change mode) command to grant users permission to the hidden .git directory.

[john.doe@localhost ]$ ls -lisa
12582996 0 drwxr-xr-x.  7 root root  101 Oct  8  2020 .
      64 0 drwxr-xr-x. 14 root root  193 Oct  5 22:45 ..
  438286 0 drwxr-xr-x.  8 root root  201 Oct  5 21:53 .git

 

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee

Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.





Please enter 16cfe in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |