对于 fizz 项目,我想使用 myname@example 作为我的电子邮件,所以当我将更改推送到主分支时,其他协作者将其视为我的用户名/电子邮件。 / p>
但是对于 buzz 项目,我想使用 myname@someotherdomain.example ,所以当我将更改推送到其主人时,协作者在 buzz 项目中,以便作为我的电子邮件。
除非我错了,EGit似乎只允许我配置1 user.name 和 user.email 。我该怎么办?感谢提前!
解决方案Git配置存储在以下文件中,当查找配置时,将在以下尝试订单(请参阅 git config ):
所以要配置 user.email 对于特定的存储库,请执行以下操作:
Th e库配置也可以从首选项>团队> Git>配置>存储库设置更改。
请注意,在Git中, user.name 应该是一个真正的全名,如 Jane Doe 。
I'd like to work with multiple git-based open source projects from the same machine. For each project, I'd like to associate a differnet user.name and user.email as appropriate. For instance, I might want to work on some project called fizz that is hosted on GitHub, and also work on another project called buzz that has its own privately-hosted, centralized git server/repo.
For the fizz project, I'd like to use myname@example as my email, so that when I push changes to the master branch, other collaborators see that as my username/email.
But for the buzz project, I'd like to user myname@someotherdomain.example, so that when I push changes to its master, collaborators on the buzz project so that as my email.
Unless I'm mistaken, EGit seems to only allow me to configure 1 user.name and user.email. How can I get around this? Thanks in advance!
解决方案Git configuration is stored in the following files, and when looking up configuration, it is tried in the following order (see git config):
So to configure user.email differently for a specific repository, do the following:
The repository configuration can also be changed from the preferences > Team > Git > Configuration > Repository Settings.
Note that in Git, user.name should be a real full name such as Jane Doe.
更多推荐
EGit和多个“用户”在同一台机器上
发布评论