You often use Git in different contexts, like at work and for open-source projects. You may then want to use different user names/email pairs to identify yourself.
This is not an important part of your work, and setting this up should be really
fast. That's where git-identity
comes in: setting up your identity information only takes one command with it.
Simply link or copy the git-identity
in a directory that's in your PATH
, Git
will pick it up and make it available as git identity
.
$ ln -s git-identity ~/bin/git-identity
Then you may setup a default identity with the following command (see Usage for more information):
$ git identity --define default Me [email protected]
Print the current identity:
$ git identity
Current identity: [default] user <[email protected]>
Change identity:
$ git identity user2
Using identity: [default2] user2 <[email protected]>
Listing identities:
$ git identity --list
Available identities:
[default] user <[email protected]>
[default2] user2 <[email protected]>
Adding an identity:
$ git identity --define <identity name> <user name> <user email>
Deleting an identity:
$ git identity --remove <identity name>