如何更改 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 13:44:05  来源:igfitidea点击:

How do I change the default author and committer in the Eclipse Git plugin?

eclipsegiteclipse-pluginegitauthor

提问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.

此外,我想设置默认显示的默认作者和提交者。

Enter image description here

在此处输入图片说明

回答by Guillermo Garcia

  1. Click Window > Preferences > Team > Git > Configuration
  2. Click Add Entryand enter the key value pairs:

    • Key: user.name
    • Value: YourUsernameHere

      And

    • Key: user.email
    • Value: YourEmailHere
  1. 单击窗口 > 首选项 > 团队 > Git > 配置
  2. 单击添加条目并输入键值对:

    • 重点: user.name
    • 值:您的用户名这里

    • 密钥: user.email
    • 值:YourEmailHere

回答by GoZoner

Each developer should perform:

每个开发人员都应该执行:

git config --global user.name "<name of user>"
git config --global user.email "<email of user>"

If you want to change the author of an existing commit, look here

如果要更改现有提交的作者,请查看此处

回答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 --globalflag; 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 --globalflag. 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

回答by Krutik Jayswal

In Eclipse v4.4(Luna) it will work like the below way.

Eclipse v4.4(Luna) 中,它将按照以下方式工作。

Enter image description here

在此处输入图片说明