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

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

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

It works fine outside of htdocs /, but I would like to have repositories inside this directory in order to work with them at the same time.

I used git bash with administrator rights and AFAIR, there is nothing else that could be wrong with respect to privileges on Win machines.

Any help would be appreciated!

Using:

  • Win7 x64

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


[update]

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


Bypass

Use TortoiseGit to create a repo in a directory that causes problems. A good chance that he will be successful.

Sometimes the git GUI (from msysgit) successfully creates a "problem" repo (it worked on my last repo in this folder, not this one).

+4
source share
3 answers

This may be due to an error with Git1.6.5.1 at 64 bit: this is a Japanese tweet mentioned

msysgit 1.6.5.1 だ と "error: unable to create directory for [project] /. git / HEAD." と か 言 っ て γƒͺ ポ γ‚Έ っ た. ζ•£ γ€… ζ‚© γ‚“ だ 後, 1.6.3.2 に バ γƒΌ γ‚Έ ョ ン δΈ‹ げ た ら あ っ さ γ‚Š 成功

Which Google ruffly translates to:

it msysgit 1.6.5.1 "error: cannot create directory for [project] /. git / HEAD." And they could not pull out the repository, including me.
After the devastating agony, version 1.6.3.2 δΈ‹ Getara success is easy

So switching to 1.6.3.2 might be the answer here.
But I did not find an open error supporting this .

As the saying goes: γͺ γ‚“ じ ゃ こ γ‚Š ゃ. (WTF);)

Also check (if you use TortoiseGit) to use the 64-bit version, not the 32-bit one.

+2
source

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

+1
source

A few hours later (I thought I did it already!). I found out what my problem was: I read this stream and only a few other areas ... (User Access Control in Windows Visa 32-bit).

Hope this helps someone else ...

I had to disable UAC [uncheck]. And then reboot - I did a soft (exit) in my initial attempt.

Again, hope this helps.

0
source

Source: https://habr.com/ru/post/1299108/


All Articles