Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

error: cannot open .git/FETCH_HEAD: Permission denied

I am using Sourcetree 3.2.6 and I have a Bitbucket account. I have suddenly run into an issue where I can no longer pull to one of my Windows machines. When I try to pull or fetch any repo I get the following error:

git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin
error: cannot open .git/FETCH_HEAD: Permission denied
error: cannot open .git/FETCH_HEAD: Permission denied
error: cannot open .git/FETCH_HEAD: Permission denied
error: cannot open .git/FETCH_HEAD: Permission denied
Completed with errors, see above.

From what I've seen this looks like my Windows user does not have permission to write to the directory, however, I can confirm that under Properties > Security the user groups I belong to have full access, and I have even added my account explicitly. I can add and remove files via explorer with no issues.

I've reinstalled Sourcetree with no luck. I've also tried moving the repo into various other directories (e.g. other drives/partitions, user folder, etc) without success.

I've had issues with my Bitbucket account not authenticating recently within Sourctree, but that is all working fine now. Clicking on Remote loads up the Bitbucket page for the repo with no issue. No red exclamation mark either.

Any ideas how I can get back to a working setup?

1 answer

0 votes

Hi @sodally ,


The Git “Cannot open .git/FETCH_HEAD: Permission denied” error occurs when you try to pull code from a remote repository when the .git/ directory in your project folder is inaccessible to your current user.

To solve this error, make sure that your current user has read-write privileges to the Git repository with which you are working.

Please check read/write/modify permissions of your user using the following article,attributes%2C%20owner%2C%20and%20permissions.

Hope this helps,


Suggest an answer

Log in or Sign up to answer

Atlassian Community Events