Fil Fil - 23 days ago 19
Git Question

Error cannot stat upon git pull

I tried to perform a git pull from a remote branch with the following command:

$ git pull origin branch_name
username@private_repository's password:
From ssh://private_repository/path/project
* tag branch_name -> FETCH_HEAD
error: cannot stat 'path/name/of/file': Permission denied
error: cannot stat 'path/name/of/file': Permission denied


But I get the following error:

error: cannot stat 'path/name/of/file': Permission denied
error: cannot stat 'path/name/of/file': Permission denied


Does anyone know what this means and what can I do about it?

Thanks

Answer

The explanation is easy -- you have a security problem with your permissions on your git files and repositories. You need to have permissions to pull your files from git.

If the directory permissions are 755 (rwxr-xr-x) including all parent directories, anyone can list the directory contents.

But you can't, so this usually means that the full directory path doesn't have 755 permissions. This also means that all parent directories must have +x permission.

Comments