问题
Is it possible to have multiple git accounts in Eclipse(egit)
and choose which one to use each time?
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.
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), e.g. username:githubuser and 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) ?
回答1:
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:
$ cd project-repo
$ git config user.name "<name>"
$ git config user.email "<mail>"
来源:https://stackoverflow.com/questions/25379478/using-multiple-git-accounts