如何更改 Eclipse Git 插件中的默认作者和提交者?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10663492/
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
How do I change the default author and committer in the Eclipse Git plugin?
提问by Dmytro Danylyk
I am using the Git plugin for Eclipse. I have several authors and committers which are displayed when I start typing in those fields.
我正在为 Eclipse 使用 Git 插件。我有几个作者和提交者,当我开始在这些字段中输入时会显示它们。
How can I provide changes to this list, or remove some author or committer?
如何更改此列表,或删除某些作者或提交者?
Also I want to set my default author and committer which will be displayed by default.
此外,我想设置默认显示的默认作者和提交者。
回答by Guillermo Garcia
- Click Window > Preferences > Team > Git > Configuration
Click Add Entryand enter the key value pairs:
- Key: user.name
Value: YourUsernameHere
And
- Key: user.email
- Value: YourEmailHere
- 单击窗口 > 首选项 > 团队 > Git > 配置
单击添加条目并输入键值对:
- 重点: user.name
值:您的用户名这里
和
- 密钥: user.email
- 值:YourEmailHere
回答by GoZoner
回答by robinst
EGit should ask you the first time you commit something. But you can always change it later on, see here: http://wiki.eclipse.org/EGit/User_Guide#Identifying_yourself
EGit 应该在您第一次提交某些内容时询问您。但是您以后可以随时更改它,请参见此处:http: //wiki.eclipse.org/EGit/User_Guide#Identifying_yourself
回答by JerryGoyal
Changing Your Committer Name & Email Globally
在全球范围内更改您的提交者姓名和电子邮件
You can run the "git config
" command with the --global
flag; this will make sure all of your future commits use the given information:
您可以运行git config
带有--global
标志的“ ”命令;这将确保您未来的所有提交都使用给定的信息:
$ git config --global user.name "John Doe"
$ git config --global user.email "[email protected]"
Changing Your Committer Name & Email per Repository
更改每个存储库的提交者姓名和电子邮件
If you want to use special settings only when working in a certain repository, you can simply omit the --global
flag. This makes the configuration valid only in that repository:
如果您只想在某个存储库中工作时使用特殊设置,您可以简单地省略该--global
标志。这使得配置仅在该存储库中有效:
$ git config user.name "John Doe"
$ git config user.email "[email protected]"
Git Cheatsheet: git for dummies
Git 备忘单:用于傻瓜的 git