fatal could not create work tree dir C Program Files Git data Permission denied

0 votes

Hi Guys,

I am trying to clone a repository using git clone command. But it is showing me the below given error.

$ git clone https://github.com/user/branchmerge.git /data
fatal: could not create work tree dir 'C:/Program Files/Git/data': Permission denied

Can anyone help me to resolve this error?

Jun 12, 2020 in Git & GitHub by akhtar
• 38,210 points
5,885 views

1 answer to this question.

0 votes

Hi@akhtar,

You may get this error if your folder contains previous files. So before git clone command try to remove all the files from that folder. You can use the below-given command.

$ rm -rf *
$ git clone https://github.com/user/branchmerge.git /data

I hope this will help.

answered Jun 14, 2020 by MD
• 95,320 points

Related Questions In Git & GitHub

0 votes
1 answer

gerrit-cherry-pick:fatal: 'origin' does not appear to be a git repository

The user account making that command does ...READ MORE

answered Aug 13, 2018 in Git & GitHub by Kalgi
• 52,370 points
852 views
0 votes
1 answer

fatal: Not a git repository (or any of the parent directories): .git

Hi@akhtar, I think you didn't initialize your folder ...READ MORE

answered Apr 29, 2020 in Git & GitHub by MD
• 95,320 points
6,093 views
+1 vote
1 answer

How to remove untracked files from the current Git working tree?

Hi@akhtar, If you have thousands of file then ...READ MORE

answered Sep 4, 2020 in Git & GitHub by MD
• 95,320 points
324 views
0 votes
1 answer

How to solve Permission denied (publickey) error when using Git?

Hi@akhtar, If the user has not generated an ...READ MORE

answered Jan 4 in Git & GitHub by MD
• 95,320 points
649 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
1,324 views
+2 votes
1 answer
0 votes
1 answer

error: Could not read error: unable to read tree object HEAD nothing to commit (working directory clean)

Hi@akhtar,  This kind of error may occur if ...READ MORE

answered Apr 10, 2020 in Git & GitHub by MD
• 95,320 points
3,131 views
+1 vote
2 answers

fatal: unable to access could not resolve host: GitHub

Hi@akhtar, This can be caused in incorrect proxy ...READ MORE

answered Apr 10, 2020 in Git & GitHub by MD
• 95,320 points
46,970 views