在 Netbeans 中更改 Git 提交者

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8803714/
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 12:42:28  来源:igfitidea点击:

Change Git commiter in Netbeans

gitnetbeans

提问by teamcrisis

In Netbeans 7.1 Git support has been added, however, I don't see a way to change commiter information. Currently, it's defaulting to my system information which is not what I want. Is there any way to change this?

在 Netbeans 7.1 中添加了 Git 支持,但是,我没有看到更改提交者信息的方法。目前,它默认为我的系统信息,这不是我想要的。有什么办法可以改变这种情况吗?

回答by ThiefMaster

Try setting it in the local gitconfig file .git/config:

尝试在本地 gitconfig 文件中设置它.git/config

[user]
        name = yourname
        email = youremail

回答by AVIDeveloper

You can just edit the default text in the combo boxes and NetBeans will remember it for next time. The data is saved in a git.propertiesfile, for example: C:\Users\USERNAME\.netbeans\7.1.2\config\Preferences\org\netbeans\modules\git.properties).

您只需编辑组合框中的默认文本,NetBeans 就会记住它以备下次使用。数据保存在一个git.properties文件中,例如:) C:\Users\USERNAME\.netbeans\7.1.2\config\Preferences\org\netbeans\modules\git.properties

EDIT:

编辑:

As per the below comment, it seems that the config file's location changed in NetBeans 8 (I don't use NetBeans for a long time already).

根据下面的评论,似乎配置文件的位置在 NetBeans 8 中发生了变化(我已经很长时间没有使用 NetBeans)了。

Here's an alternative location according to @tzi: C:\Users\USERNAME\AppData\Roaming\Netbeans\8.0.1\config\Preferences\org\netbean??s\modules\git.properties

根据@tzi,这是一个替代位置: C:\Users\USERNAME\AppData\Roaming\Netbeans\8.0.1\config\Preferences\org\netbean??s\modules\git.properties

回答by Andreas

this helped me: https://help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user

这对我有帮助:https: //help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user

Configuring git

配置git

To check your git setting, run this command:

要检查您的 git 设置,请运行以下命令:

git config user.email
# [email protected]

If this email is not correct, you can change the global setting:

如果此电子邮件不正确,您可以更改全局设置:

git config --global user.email "[email protected]"

回答by Basemm

it worked in netbeans v7.3.1/windows 7 by adding those entries

它通过添加这些条目在 netbeans v7.3.1/windows 7 中工作

name = github user name

名称 = github 用户名

email = github registered email

email = github注册邮箱

in file

在文件中

C:\Users\[USER NAME]\AppData\Roaming\NetBeans\7.3.1\config\Preferences\org\netbeans\modules\git.properties

C:\Users\[用户名]\AppData\Roaming\NetBeans\7.3.1\config\Preferences\org\netbeans\modules\git.properties

回答by jezmck

Windows 7 file location:

Windows 7 文件位置:

C:\Users\USERNAME\.gitconfig

回答by joar

This is covered in the Git Community Book.

这在Git 社区手册 中有介绍

It will work unless what you are trying to achieve is to have two sets of committer information on the OS same user account.

除非您要实现的是在操作系统的同一用户帐户上拥有两组提交者信息,否则它将起作用。

From the page:

从页面:

[user]
    name = Scott Chacon
    email = [email protected]