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

by
Jeremy Canfield |
Updated: October 06 2022
| Git (Version Control) articles
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