gpt4 book ai didi

windows - GIThub 和非英文窗口?

转载 作者:可可西里 更新时间:2023-11-01 10:28:54 26 4
gpt4 key购买 nike

您可能知道,Git Bash 不支持非 pull 丁字符。这会导致在创建和使用 SSH key 时出现多次失败(因为路径是俄语)。

有解决办法吗?

最佳答案

这完全取决于你的HOME指向哪里?

参见 Issue 491 :

总结一下我的测试,如果 Windows 用户名包含非 ASCII 字符:

  1. If the HOME environment variable is set to an ASCII path, and that path exists, Git Bash finds it (so that is one possible workaround).

  2. If there is no HOME environment variable and the HOME constant in "git/etc/profile" is set to an ASCII path, and that path exists, Git Bash finds it. The behaviour seems to be exactly the same as in 1.

  3. If the HOME environment variable is set to a non-ASCII path (like "C:\Höme"), Git Bash doesn't find it. It attempts to fall back on the C:\Documents and settings\[User Name] directory, but it fails to find it because it mangles the non-ASCII characters in the [User Name].

  4. After the HOME system environment variable (or the constant in git/etc/profile) is set to a fully ASCII path, Git Bash finds the home directory, but it still mangles the user name in the displayed messages.

  5. The first time I run Git GUI, when I try to stage and commit a file, there is an error that says that there are invalid utf-8 characters in the commit message.
    The workaround for this consists in opening the Edit->Options dialog and entering a valid user name and an email address in the corresponding edit boxes.
    It seems that Git is composing an extended message based on my message plus the user name and email. Because the fields are empty, it seems to try to generate default values out of the Windows user name, but it probably retrieves that as an ISO-8859-1 string on my system, and then another part of the code expects that to be valid utf-8, but it isn't.

  6. If the user name and email fields are left empty, I've also come across the error shown in the image "error2.jpg" above when trying to modify some options in the Edit->Options dialog. However, this error doesn't always happen, and I'm not sure about the exact steps that lead to it.

  7. After I've set the HOME variable and the user name and email address, I can work without any problems, except for the next one.

  8. Non-ASCII paths and file names can be staged and committed if they are made up of characters in the local Windows encoding (I think that's ISO-8859-1 for Spanish, English and most Western European Windows systems).
    So, I've been able to stage and commit a file with the name "cañón.txt".
    However, if the path contains Unicode characters impossible to represent in the local Windows encoding, like "C:\My tests\test五.txt", such files appear mangled in the Git GUI window, and give a "no such file or directory" error when I attempt to stage them.

关于windows - GIThub 和非英文窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5382423/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com