Error with git pull error: cannot open .git / FETCH_HEAD: permission denied

I am looking for help!

I get the following error message when I try to execute git pull;

C: \ Jenkins \ Repo> git pull error: cannot open .git / FETCH_HEAD: Permission denied

This machine is part of the Windows Server 2008 r2 operating system and uses ssh for authentication.

We tried the following: Checked that the current user is correctly reading / writing to the FETCH_HEAD file, which he does, also checking that the user has the correct permissions set for the repo root.

I tried to download my private key (which I know that 100% works and has permissions for the corresponding repo) and still the same problem ... so from little I know about git I think this is more of a problem with Windows

and a lot of google!

More ideas on what to do / check would be a big help!

+5
source share
3 answers

This happened to me after I upgraded to Windows 10. Although my user is an administrator and administrators have full access to the root repo folder, my user is not explicitly specified. I added my user with full control, and he solved the problem for me (had the same problem as Outlook, refusing to read the PST file until I did the same).

So for me the solution is:

  • Right click on the folder, select properties
  • Security
  • Edit
  • Add
  • Enter username
  • Mark full control in the "Allow" section
  • OK OK
+8
source

This is a fairly common problem. I came across it many times and almost all the time, the problem is the correct permissions in repo / directory .git/ and the correct SSH keys to access the git repository.

You probably need to make the user the owner of the chown repository (grant full access to the user) or clone the repository into another directory.

You can set write permission with the following command, go to the folder chown -R youruser:yourgroup .git/

Also try undoing the hidden .git folder.

+3
source

In my case, this happens because I hide the .git folder manually (usually it will be hidden automatically), but I forgot it.

I tried editing security, but no effect. So I just show the .git folder and solve the problem.

Maybe this might help someone.

0
source

All Articles