Utility that helps you switch git configurations with ease
It is possible that you have multiple git configurations. For example
; Office Profile
Name: John Doe
Email: [email protected]
; Personal Profile
Name: John Doe
Email: [email protected]
It could be a hassle to remember and switch between the profiles while working on different projects.
This utility aims to make this hassle free.
- Create and manage profiles globally; create once, use anywhere
- Set profile for a specific project
- Set global profile with a single command
This utility helps you save profiles and then you can switch between them using a single command.
- Download the file from here
sudo chmod -R 755 git-profile
sudo mv git-profile /usr/local/bin/git-profile
$ git profile [options] <command>
Options
-h, --help Display this help message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
Commands
rm Remove git profile
use Change git profile locally or globally
add Create a new git profile
show Show details for an existing profile
update Update details for an existing profile
current Gets the currently set profile
Find some of the sample usages below
$ git profile add
[+] Enter profile title: Office
[+] Enter Name: John Doe
[+] Enter Email: [email protected]
[OK] Profile "Office" saved successfully
$ git profile rm "Office"
[OK] Profile "Office" successfully removed
$ git profile show "Office"
[+] Name: John Doe
[+] Email: [email protected]
$ git profile update "Office"
[+] Enter Name: Jane Doe
[+] Enter Email: [email protected]
[OK] Profile "Office" updated successfully
Setting details locally i.e. set profile for the current project
$ git profile use "Office"
[OK] Switched to "Office"
Setting details globally i.e. set global configuration
$ git profile use "Office" --global
[OK] Switched to "Office"
$ git profile current
[+] Current Profile "Office"
[+] Name: John Doe
[+] Email: [email protected]
Side note It should be noted that profiles are maintained globally. When you use
some profile locally, what it does is get the configuration for that profile and sets it for the current project. i.e. when use
is run locally it is equivalent to
git config user.name "Name for specified profile"
git config user.email "[email protected]"
MIT © Zeeshan Ahmed