Git Bash For windows

I’m trying to do the exercises with Git fo windows that code academy gives me but I cant. When I try to mkdir in the git bash it says "cannot create directory ‘bum’: Permission denied
" how can I get permission for that so I can continue my courses.

being denied permission doesn’t necessarily mean the best way forward is to get permission, there’s also the option of reconsidering what you meant to do.

For example, if you’re trying to create your directory in C:/Program Files then rather than forcing it with admin you might want to create it somewhere under your user directory, like C:/Users/Jimmy/workspace

2 Likes

thanks. But I don’t know how to get there. when I run the comman pwd this is what it shows me "damib@LAPTOP-O03VI3MP MINGW64 /
" I don’t even know whats that. why it doesn’t say windows C: or something? besides, im worried that using git on my own pc could damage something if I mess up

1 Like

A lot of unix tools assume the file system starts at /, not at some drive letter, and definitely not at some un-addressable thing where the drive letters exist.

I think mingw might place your C drive at /c, so you’d navigate to…

$ cd /c/Users/Jimmy
$ mkdir workspace

There might also be a home directory somewhere under mingw:

$ cd ~   # bash replaces ~ with the location of your home directory
$ mkdir workspace

Your result of pwd, damib@LAPTOP-O03VI3MP MINGW64 /
Suggests that you’re at the very top of the file system (/), normally you’d do things from /home/Jimmy, assuming that a directory exists for your user, that’s where you’d have write permission (as opposed to in locations owned by the os, which might not even have a physical location in your hard drive)

1 Like

Hello, I had the same problem.

I can go to cd ~ folder, and create a directory there. But i can’t create a directory in “C:\Program Files\Git”. When I analyze this folder, I see that it is read only for admin and users by default. (i don’t know why is this so?)

I changed the permissions to full authority for the admin and users. Therefore I can create directory right now. I hope my solution doesn’t damage any other thing:sweat_smile:

Imagine driving on a road.

The road is blocked.

You decide that this means you need to unblock it.

You continue to drive.

You fall off a cliff.

Guess why it was blocked.

The road block wasn’t telling you that you need to remove it, but that you probably meant to go somewhere else.


I get the feeling that the only reason you think you need to change anything about C:\Program Files is that you were denied permission to do so. There are plenty of directories where you already have write access, is there anything wrong with those? Is your solution solving a problem?

Yes it solved the problem, but I get your point.
I will try another approach.
Thanks a lot!