在 Egit (Eclipse) 中更改用户位置(主变量)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6989847/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Change User location(home variable) in Egit (Eclipse)
提问by Kyrylo Zapylaiev
I use Eclipse Indigo and Windows 7 and plugin egit/jgit for Eclipse.
我使用 Eclipse Indigo 和 Windows 7 并为 Eclipse 使用插件 egit/jgit。
How to change user location in egit? I should do it, because it contains special characters, which doesn't understand egit. I want "C:\git\home\.gitconfig" instead "C:\Users\Кирилл\.gitconfig". How can I do it? When I press "Open" nothing happens.
如何在egit中更改用户位置?我应该这样做,因为它包含不理解 egit 的特殊字符。我想要“C:\git\home\.gitconfig”而不是“C:\Users\Кирилл\.gitconfig”。我该怎么做?当我按“打开”时,什么也没有发生。
And in the next Tab "Repository setting" I don't change anything too.
在下一个选项卡“存储库设置”中,我也没有更改任何内容。
回答by Gershon Herczeg
You need to add an environment variable: This is how i did it on windows 7
您需要添加一个环境变量:这就是我在 Windows 7 上的做法
- Click start button.
- Right click "Computer"
- Click "Properties"
- Click "Advanced System Settings"
- "Environment variables" in "Advanced" tab.
- Click the "New" button to create a new variable under user variables pane.
- Enter "HOME" in the name field
- Enter "%USERPROFILE%" or some other path in the value field. (HOME should point to your home directory e.g. C:\Users\Tom. Ensure correct case! E.g. C:\users instead of C:\Users may cause problems!)
- Click OK, and OK again. You have just added the Home directory on Windows.
- 单击开始按钮。
- 右键单击“计算机”
- 点击“属性”
- 点击“高级系统设置”
- “高级”选项卡中的“环境变量”。
- 单击“新建”按钮在用户变量窗格下创建一个新变量。
- 在名称字段中输入“HOME”
- 在值字段中输入“%USERPROFILE%”或其他一些路径。(HOME 应该指向您的主目录,例如 C:\Users\Tom。确保大小写正确!例如 C:\users 而不是 C:\Users 可能会导致问题!)
- 单击确定,然后再次确定。您刚刚在 Windows 上添加了主目录。
回答by Sam Hasler
Git reads the XDG_CONFIG_HOME environment variable to find the users git config (see http://git-scm.com/docs/git-config) but unfortunately JGit doesn't look at it.
Git 读取 XDG_CONFIG_HOME 环境变量以查找用户 git config(请参阅http://git-scm.com/docs/git-config),但不幸的是 JGit 没有查看它。
I've raised a bug here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=430194
我在这里提出了一个错误:https: //bugs.eclipse.org/bugs/show_bug.cgi?id=430194
please log in to the Eclipse Bugzilla and vote for it.
请登录 Eclipse Bugzilla 并为其投票。