[英]Using multiple Git accounts
Is it possible to have multiple git accounts in Eclipse(egit)
and choose which one to use each time? 是否有可能在
Eclipse(egit)
有多个git帐户Eclipse(egit)
并选择每次使用哪一个?
Example: 例:
I currently have a git account, with username: workuser and email: workuser@company.com and this account is used for the company's repositories. 我目前有一个git帐户, 用户名:workuser和email:workuser@company.com ,此帐户用于公司的存储库。
I want to use another account which will be used for my github repositories and will not have any relation to the first account ( workuser ), eg username:githubuser and email: anothermail@something.com 我想使用另一个帐户,它将用于我的github存储库,并且与第一个帐户( workuser )没有任何关系,例如用户名:githubuser和email:anothermail@something.com
Is it possible to have both accounts and choose each time which account will be used in order to work on the related repositories(different for work and github) ? 是否可以同时拥有这两个帐户并选择使用哪个帐户来处理相关的存储库(不同的工作和github)?
I don't know about egit, but by default, git config
(without --global
) stores values in repository-specific file, so the only thing you need to do is: 关于egit,我不知道,但默认情况下,
git config
(不带--global
)将值存储在特定于存储库的文件中,因此您唯一需要做的就是:
$ cd project-repo
$ git config user.name "<name>"
$ git config user.email "<mail>"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.