In my Git repository, has accented files as éíóúàèìòùãõ_800x600.jpg, but after making clone, I can not do pull, because the file appears as modified:
$git clone [...]
done
$git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# "a\314\201e\314\201i\314\201o\314\201u\314\201a\314\200e\314\200i\314\200o\314\200u\314\200a\314\203o\314\203_800x600.jpg"
Still, I can't add, remove, reset or stash the file.
I tried:
$git add a\314\201e\314\201i\314\201o\314\201u\314\201a\314\200e\314\200i\314\200o\314\200u\314\200a\314\203o\314\203_800x600.jpg
fatal: pathspec 'a314201e314201i314201o314201u314201a314200e314200i314200o314200u314200a314203o314203_800x600.jpg' did not match any files
$git stash
No local changes to save
$git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# "a\314\201e\314\201i\314\201o\314\201u\314\201a\314\200e\314\200i\314\200o\314\200u\314\200a\314\203o\314\203_800x600.jpg"
How handle with accented files converted to unicode?
You need to set the core.precomposeunicode option to true on the Mac, and clone the repository again.
git config --global core.precomposeunicode true
As described in git config man page, the option is related to the particular decomposition of Unicode characters in Mac OS:
This option is only used by Mac OS implementation of git. When core.precomposeunicode=true, git reverts the unicode decomposition of filenames done by Mac OS. This is useful when sharing a repository between Mac OS and Linux or Windows. (Git for Windows 1.7.10 or higher is needed, or git under cygwin 1.7). When false, file names are handled fully transparent by git, which is backward compatible with older versions of git.
What the man page does not indicate, is that this option has no retroactive effect on a repository, it only takes effect in repositories cloned afterwards.
Reference: Answer by Leo Koppelkamm in "Git and the Umlaut problem on Mac OS X"
How to handle Asian characters in file names in Git on OS X
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With