Switching identities on Git is easy, but the trouble is that different repositories may need different identities to commit and pull.
git multi user management
Users with go environment
go install github.com/aimuz/git-user/cmd/git-user
Verify installation
git user -v
git user
git multi user management
Usage:
git user [command] [flags]
git user [command]
Examples:
git user create --title example --user example --email example@example.com
git user create --title example --user example --email example@example.com -i ~/.ssh/id_rsa
git user list
git user use example
Commands:
git user clean Clean current repo username and email configuration
git user create create a new git user
git user help Help about any command
git user list list all git users
git user use Switch the current repo git user
Flags:
--data string (default "/Users/aimuz/.config/git-user/user.yaml")
-h, --help help for user
-v, --version version for user
Use "user [command] --help" for more information about a command.
Help:
$ git user create --help
Usage:
git user create [flags]
Aliases:
create, a
Examples:
git user create --title example --user example --email example@example.com
git user create --title example --user example --email example@example.com -i ~/.ssh/id_rsa
Flags:
--email string git user email
-h, --help help for create
-i, --identity_file string The certificate corresponding to the user. If it is blank, the default value will be used
--title string if it is empty, username will be used
--user string git user name
Global Flags:
--data string (default "/Users/aimuz/.config/git-user/user.yaml")
$ git user create --title example --user example --email example@example.com
Successfully created example user
$ git user list
TITLE USER EMAIL IDENTITY FILE GPG KEY
example example example@example.com
git user use [title]
$ git user use example
User set successfully
-
AutoEnable
Automatically enable the specified account
-
GPG support
-
SSH Identity