3

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.

eduncan911
  • 17,165
  • 13
  • 68
  • 104
  • Where is that `_deploy` folder located wrt to the root of the Octopress tree? – jub0bs Sep 01 '14 at 18:38
  • The default location, in the root of Octopress. Remember, Octopress sets that deploy folder up differently on a master branch for GitHub pages. – eduncan911 Sep 01 '14 at 19:00
  • Are you using Octopress 2.0 or some earlier version? I have an Octopress blog, but I don't have any `_deploy` folder and my `Rakefile` is at the root of my Octopress folder. – jub0bs Sep 01 '14 at 19:02
  • 2.0, about 7 months old (I've heavily modified it). I just edited the question to ask another question: is OSX case insensitive even with that but param set to false? – eduncan911 Sep 01 '14 at 19:04

2 Answers2

1

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

eduncan911
  • 17,165
  • 13
  • 68
  • 104
  • In addition to this answer, over the years I've just created a Spare drive in macOS and formatted it case sensitive. Works fine. – eduncan911 Aug 23 '17 at 10:39
1

As mentioned in the other answer: macOS (standard hard drive partition) is case insensitive. That means your local git should be the same too.

So, do not do git config core.ignorecase false as that will mess up the things more. Also, if you rename a folder to uppercase, git doesn't track the change, except if you change the files included. So, it is very easy to miss that.

The solution that worked for me is:

  1. Copy all the folder in your case "blog" to a safe place.
  2. Delete with git rm -rf both folders ({obmitted-dir-name} and {OMITTED-DIR-NAME}).
  3. Add and commit the changes.
  4. Create the blog folder again and paste your content with the folder name you want to keep.
  5. Add and commit the changes.

You will need to do that in all related branches too.

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135