On Mon, 29 Oct 2012 18:22:47 -0700 (PDT)
Philipp Kraus <philipp.kr...@flashpixx.de> wrote:
> I'm running a PHP script which pulls & checkouts a Git repo. The
> script clones first the repo and on each next call it should get all
> new changes (git clone and than git pull).
> Sometime I get the message:
> git checkout-index unable to create file (permission denied)
> exspecially on the .gitignore files. The webserver run the script and
> the file / directory owner is the webserver, also of the .gitignore
> files, so the message "permission denied" is wrong.
> I don't understand why the git client create this message
> and this problem. The PHP script checks first if the directory
> exists, if not, it runs git clone, if it
> exists it calls git --git-dir=repodir pull. Can I setup a flag to the
> git client, that it should only overwrite all files, so that the
> error is not shown?
The error most probably comes from the OS, and Git just shows it.
I mean, it's a "hard" error, occuring on the filesystem level, not a
"soft" error raised by Git itself.
Note that on POSIX systems, the possibility to create or delete (unlink)
a file is controlled by the write permission on the directory containing
that file, not by the write permission on the file itself wich controls
whether the file's *contents* can be modified.
Since `git checkout-index` says it failed to *create* a file, the
permissions on the containing directory is probably a culprit.
Now, if we assume your .gitignore file is supposed to be located in the
top-level repository directory, and you're using the "--git-dir"
command-line option to tell Git its database is located elsewhere, not
in the work tree directory, the most possible problem is that your
top-level repository directory has wrong permissions set on it.
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To post to this group, send email to email@example.com.
To unsubscribe from this group, send email to
For more options, visit this group at