Mac OS X 上的 Git 和元音变音问题 [英] Git and the Umlaut problem on Mac OS X
问题描述
今天我在 Mac OS X 上发现了 Git 的一个错误.
Today I discovered a bug for Git on Mac OS X.
例如,我将提交一个名称为 überschrift.txt 的文件,以德语特殊字符 Ü 开头.从命令 git status
我得到以下输出.
For example, I will commit a file with the name überschrift.txt with the German special character Ü at the beginning. From the command git status
I get following output.
Users-iMac: user$ git status
On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# "U314210berschrift.txt"
nothing added to commit but untracked files present (use "git add" to track)
似乎 Git 1.7.2 在 Mac OS X 上有德语特殊字符的问题.有没有办法让 Git 读取正确的文件名?
It seems that Git 1.7.2 has a problem with German special characters on Mac OS X. Is there a solution to get Git read the file names correct?
推荐答案
在mac上启用core.precomposeunicode
Enable core.precomposeunicode on the mac
git config --global core.precomposeunicode true
为此,您至少需要有 Git 1.8.2.
For this to work, you need to have at least Git 1.8.2.
Mountain Lion 随附 1.7.5.要获得更新的 git,请使用 git-osx-installer 或 自制软件(需要 Xcode).
Mountain Lion ships with 1.7.5. To get a newer git either use git-osx-installer or homebrew (requires Xcode).
就是这样.
这篇关于Mac OS X 上的 Git 和元音变音问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!