Skip to content

↔️ Git Profile allows you to switch between multiple user profiles in git repositories

License

Notifications You must be signed in to change notification settings

dotzero/git-profile

Repository files navigation

Git Profile switcher

build Go Report Card MIT License

Git Profile allows you to switch between multiple user profiles in git repositories

Installation

If you are MacOS user, you can use Homebrew:

brew install dotzero/tap/git-profile

Prebuilt binaries

Download the binary from the releases page and place it under $PATH directory.

Building from source

If your operating system does not have a binary release, but does run Go, you can build it from the source.

go get -u github.com/dotzero/git-profile

The binary will then be installed to $GOPATH/bin (or your $GOBIN).

Usage

Adds an entry to a profile or updates an existing profile

git profile add home user.name dotzero
git profile add home user.email "[email protected]"
git profile add home user.signingkey AAAAAAAA

Displays a list of available profiles

git profile list

Applies the selected profile entries to the current git repository

git profile use home

# Under the hood it runs following commands:
# git config --local user.name dotzero
# git config --local user.email "[email protected]"
# git config --local user.signingkey AAAAAAAA

Export a profile in JSON format

git profile export home > home.json

Import profile from JSON format

cat home.json | xargs -0 git profile import home

License

http://www.opensource.org/licenses/mit-license.php