User management and pairing for Git

View the Project on GitHub drrb/gitsu

Usage Examples

Switching users

Switch to fully-qalified users

$ git su 'Joseph Porter KCB <>'
Switched local user to Joseph Porter KCB <>

Switch to configured users by initials

$ git su jp
Switched local user to Joseph Porter KCB <>

or by part of their name

$ git su straw
Switched local user to Raphe Rackstraw <>

To clear all Git users

$ git su --clear
Clearing all users from Git config

Adding users

To add a user to Gitsu (the user will be saved in ~/.gitsu)

$ git su --add 'Raphe Rackstraw <>'
User 'Raphe Rackstraw <>' added to users

You can also add users manually to ~/.gitsu in the following format: Sir Joseph Porter KCB Raphe Rackstraw

Checking current users

Show current Git users in all scopes

$ git su
Current user: Raphe Rackstraw <>

Local: Raphe Rackstraw <>
Global: Raphe Rackstraw <>
System: (none)

Show the current Git users in specified scopes (simplified output for use in scripts)

$ git su --local --global
Raphe Rackstraw <>
Raphe Rackstraw <>

Show the current Git user that Git would use to commit

$ git whoami
Raphe Rackstraw <>


Gitsu supports Git's configuration scopes: local (current repository), global (current OS user), and system (everyone on the system). As with Git, if you don't specify a scope, local scope is assumed.

To change the user for a specific scope

$ git su joe --system
Switched system user to Joseph Porter KCB <>

To clear the user for a specific scope

$ git su --clear --global
Clearing Git user in global scope

Miscellaneous Features

To display the options available for Gitsu

$ git su --help

To list all the users Gitsu knows about

$ git su --list
Joseph Porter KCB <>
John Galt <>

To open the Gitsu config file in an editor (the same one Git uses)

$ git su --edit