EGit and multiple "users" on the same machine

I would like to work with multiple git based open source projects from the same computer. For each project, I would like to link differnet user.name

and user.email

as needed. For example, I might want to work on some project called fizz

, which is hosted on GitHub, and also work on another project called buzz

, which has its own centralized server. >

For a project, fizz

I would like to use myname@example.com

both my email so that when I push changes on the master thread, the other contributors see it as my username / email.

But for a project buzz

I would like to use user myname@someotherdomain.example.com

, so when I push changes to my master, the project collaborators buzz

to as my post.

If I'm wrong, EGit only seems to allow me to configure 1 user.name

and user.email

. How can I get around this? Thanks in advance!

+2


source to share


1 answer


Configuration

Git is saved in the following files and when looking for a configuration is executed in the following order (see Git config ):

  • Local: .git/config

    in the current repository
  • Global: .gitconfig

    in the user's home directory
  • System: gitconfig

    in the system configuration directory (e.g. /etc

    on Linux)

So, to set up user.email

differently for a specific repository, do the following:



  • Open repository properties from the Git Repositories view
  • In the Configuration tab, click Add Entry ...
  • Enter user.email

    as key and required value
  • Click "OK"

The repository config can also be changed from Settings> Team> Git> Config> Repository Settings.

Note that in Git, there user.name

must be a real fully qualified name, eg Jane Doe

.

+1


source







All Articles