开发者

git init error: unable to create directory for .git/HEAD [inside htdocs/]

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

  $ git init  
  error: unable to c开发者_开发问答reate 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 the directory 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).


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.


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


After a few hours of (I thought I did that already!....) I found out what my problem was - as I read this thread and only a few other areas.... (User Access Control on Windows Visa 32-bit).

Hope this helps someone else....

I had to unset UAC [uncheck] it. And, then reboot - i did a soft (logoff) in my initial attempt.

Again, hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜