rubymacosgitoctopress

Rake w/Git says 'fatal: Will not add file alias' but I can do it manually?


I've got an odd problem. Using Octopress on OS X, which uses a Rakefile (ruby) to setup deployment folders and such with a unique Git repository structure.

The problem is this line:

system "git add -A"

...in the Rakefile generates this error:

fatal: Will not add file alias 'blog/{obmitted-dir-name}/index.html' ('blog/{OMITTED-DIR-NAME}/index.html' already exists in index)

Ok, so this sounds like a casing issue and I should issue:

$ git config core.ignorecase false

Nope, still the same error and I've verified it is set to false now. So then I issue:

$ git config --global core.ignorecase false

Still no go.

And now for the odd part... I can manually change directories to my _deploy/ dir and issue the command manually:

_deploy/$ git add -A

No problem!

I've verified this numerous times... The Ruby Rakefile cannot issue git add -A, whereas I can do it manually.

I even stopped the script directly on that step and did it manually.

Does Ruby have a different Git environment it runs from?

Is OSX case insensitive even with setting that git flag? If so, that's my problem and I'll never be able to deploy from OSX (just like I can't deploy from Windows): I have upper and lower case aliases for 404s to redirect.


Solution

  • It turns out the issue is indeed that OSX is case-insensative (I didn't know this!) - which in turn doesn't allow git to perform the aliases of different casing.

    That's the same issue I had on Windows and is why I moved to Linux. Looks like I'll have to keep a Linux VM handy to handle updates to my static blog (Octopress/Jekyll) cause I do have traffic on both casing of the urls.

    If you are reading this and want to remain on OSX with mixed-case blog posts, the answer would be to create a virtual disk that has case sensitivity, mount it permanently and move your Octopress/Jekyll install to it. See: https://gist.github.com/dixson3/8360571