Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Git Basics Getting Started With Git Working With Git Repositories

nico dev
nico dev
20,364 Points

"fatal: cannot mkdir myRepName: Permission denied"


I installed Git and Gitpad on my Windows computer and now opened the Git bash and checked my version of Git. It's "git version 2.13.1.windows.2". So it should be alright until there.

Now, once I try the git init whatever_the_name_of_repository, the repository is not created and even worse, I receive a message "fatal: cannot mkdir myRepName: Permission denied".

Truth is I am a little confused as to how to install a console that works like the POSIX bash? Have I? I tried the "ls" and the "ps aux" and they work normally. But I am not fully sure where am I working?

Sorry if my questions are terribly stupid, but I really would like to work through this, and I have no further info.

Hope someone can give me a hand on this one. Thanks in advance!

2 Answers

Jennifer Nordell
Jennifer Nordell
Treehouse Teacher

Generally speaking, when you get a "Permission denied" it means that you do not have the rights on the computer to do what you're trying to do. Is your Windows account a local administrator? If not, log in to an administrator account. You can also try running Git bash by searching for the program, right-clicking on it, and then choosing "Run as administrator". Also, you can try to issue your command prefixed with "sudo".

Let me know if any of these work (or not)! :sparkles:

nico dev
nico dev
20,364 Points

Hey Jennifer Nordell

Thank you so much for your reply and patience.

I didn't find the solution that way but anyway it gave me that click idea about which was the completely noob thing I was doing with my Git. So I thought it was a cracker all the same (NOTE: cracker in the sense of successful, no pirating pun intended).

Turns out, at least in my Win 10, Git opened by default from some form of "root" directory (I don't know where it is in Windows, to be honest, but it looks deeper than C/), but I wasn't allowed to do nothing, even mkdir from there. So I was like, "administrator account" ah, where am I?

So I tried to cd to the home directory and there I go, in /c/Users/Nico I can do mkdir, I can do git init and it works, etc.

A trillion thanks!