tags:

views:

403

answers:

2

Hello,

when I try to create a repo inside htdocs folder of my Apache installation (using Zend Server CE) git gives me the error:

  $ git init  
  error: unable to create directory for e:/WORK/Zend/Apache2/htdocs/gittest2/.git/HEAD

It works well outside htdocs/, but i would like to have repos inside this dir in order to work on them at the same time.

I have been using git bash with administrator privilages and AFAIR there's nothing else that could be wrong regarding privilages on Win machines.

Any help will be appreciated!

Using:

  • Win7 x64

  • git installed from msysGit -> Git-1.6.5.1-preview20091022.exe


[update]

  • as VonC suggested it might be a bug in this release of msysGit


Workaround

Use TortoiseGit to create a repo in directroy that's causing you problems. Good chance it will be successfull.

Sometimes Git GUI (from msysgit) will successfully create a 'troublesome' repo (worked on my last repo in this folder, not this one though).

+1  A: 

Double-check the permissions on the folders htdocs/ and gittest2/. Enable both read and write permissions.

blinry
I gave full control on these 2 folder to all the groups/users on my system. The error is still the same.
yogal
Are you able to create a directory there by hand from shell?
Marcin Gil
Yes I can create folders and files there using git bash, even smt like touch .git/HEAD will work manually
yogal
+2  A: 

It may be related to a bug with Git1.6.5.1 on 64 bit: this Japanese tweet mentions

msysgit 1.6.5.1 だと"error: unable to create directory for [project]/.git/HEAD."とか言ってリポジトリが作れなかった。
散々悩んだ後、1.6.3.2にバージョン下げたらあっさり成功

Which Google ruffly translates as:

it msysgit 1.6.5.1 "error: unable to create directory for [project] / .git / HEAD." Nor could they pull the repository including me.
After the devastating agony, 1.6.3.2 version下Getara success lightly

So a downgrade to 1.6.3.2 could be the answer here.
But I did not found any opened bug supporting that.

As they say: なんじゃこりゃ。(WTF) ;)

Check also (if you are using a TortoiseGit), to use the 64-bit version and not the 32-bits one.

VonC
Thanks for the response, you gave me and idea. I will try to use TortoiseGit to init a repo, since i'm using git bash purely. I will update on this
yogal
As i tought, I was able to create a repo using TortoiseGit. I am now able to work on this using git bash.
yogal