Gitu is a tiny script for managing multiple git names/emails. It moves git config --global user.name NAME
and git config --global user.email EMAIL
to a quick, easy command. Profiles (sets of names and emails) are stored in a yaml file at ~/.git_users.yml.
- *nix operating system (Mac OS X or Linux)
- Ruby 2.0.0 or greater
./gitu
should be placed in /usr/local/bin/
so it can be executed with gitu
. Use curl or wget for easiest installation. ~/.git_users.yml
is automatically generated if it doesn't exist the first time any gitu command is run.
curl -o /usr/local/bin/gitu https://raw.githubusercontent.com/net/gitu/master/gitu && chmod a+x /usr/local/bin/gitu
wget -P /usr/local/bin https://raw.githubusercontent.com/net/gitu/master/gitu && chmod a+x /usr/local/bin/gitu
Profiles are named sets of names and emails. Example:
github:
name: net
email: [email protected]
bitbucket:
name: net
email: [email protected]
gitu [profile]
sets the git global name and email. For example gitu github
would set the global name and email to the name/email defined under github in ~/.git_users.yml
gitu
shows the current profile.
gitu -s [profile]
sets the profile for the current repository. This adds the name/email to .git/config
so it stays in effect even after you leave the repository.
gitu + [profile name] [name] [email]
adds a profile. Profiles can also be added directly in ~/.git_users.yml
.
gitu - [profile name]
removes a profile. Profiles can also be removed directly in ~/.git_users.yml
.
gitu -v
returns the current version.