Git, Mac OS X and accented characters

2020-03-02 04:57发布

问题:

On MacOSX with Git, there is a problem with different UTF8 representations of filename encodings. (Similar problems also exists in SVN.)

There is a patch for this here.

I wonder if there is any bug report (in their bug tracker which I haven't found yet) with any discussion about why this haven't been pulled yet or if anyone is working on it, etc.

回答1:

Enable core.precomposeunicode on the Mac

git config --global core.precomposeunicode true

Then reclone the repository. For this to work, you need to have at least Git 1.7.12, which is bundled with Xcode 4.6.

That's it.



回答2:

This problem is very known and very understood, see, for example this one. Linus have some voice on this thread too.

There are some patch that paper over the problem, and no developer care enough / have to skill to fix it in the proper way. Maybe, i guess, it is impossible to fix this without breaking old commits.



回答3:

Well, it was stated here that there is no bug tracker and the common way is to send a mail to their mailing list.

I just did that here. And I messed up the thread a bit. :) Further discussion is here.



回答4:

Besides the patch there is a workaround by translating Mac OS X the encoding for git! that seems to work for me.



标签: macos git utf-8