A git extension to allow you manage multiple git profiles on your workstation. User profiles can have independent configurations. They can also share configurations.
Git-profile-manager can be installed using the python pip
tool.
pip3 install git-profile-manager
# pip install git-profile-manager
## Upgrade
pip3 install git-profile-manager --upgrade
NOTE: After installation, your current git config will be used as a shared configuration. All users inherit from the configuration
To create a profile
git create-profile
git create-profile -e [email protected] -n "Foo Bar"
To Configure profile:
# Sets up ssh for that user
git config --global core.sshCommand "ssh -i /full/path/to/id_a/id_rsa"
NOTE: Git Profile Manager stores the user config as global config. Hence all configurations must carry the --global
flag. That means running config without the --global
flag creates a local config that overrides values set on user config
# Sets up ssh for that user
# Set config for present repository
# This Config overrides the user profile created config value for core.sshCommand
git config core.sshCommand "ssh -i /full/path/to/id_a/id_rsa"
All initial global configurations are added to the user config. For conflicts, the user's config override the global config.
To add configurations that would be shared by all users:
git global-config core.sshCommand "ssh -i /full/path/to/id_rsa"
User's configuration always override global configuration
Applies a profile to a particular directory. Once applied, any repository within the directory uses the config.
# Applies current user profile
git apply-profile /home/user/company
# Applies specified user profile
git apply-profile /home/user/personal -u personal
implemented using https://git-scm.com/docs/git-config#_conditional_includes
To Switch Profile:
git use-profile [email protected]
To Remove an existing Profile:
git remove-profile [email protected]
To get the Current Profile:
git current-profile
To list the Current Profile:
git list-profiles
- Add bash completions
- Check and add windows compatibility
- Tests