Skip to content

Instantly share code, notes, and snippets.

@cytopia
Last active August 29, 2016 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cytopia/466d3eef2fffe02b99a421c08e9dd107 to your computer and use it in GitHub Desktop.
Save cytopia/466d3eef2fffe02b99a421c08e9dd107 to your computer and use it in GitHub Desktop.
Manage multiple git identities
#
# Handle git identities
#
# Load this in your bash/zsh config
#
# Show identity
git-ident-show() {
git config --get user.name
git config --get user.email
git config --get user.signingkey
}
# Switch to default ident
git-ident-make-work() {
git config user.name "First Last"
git config user.email "first.last@company.com"
git config user.signingkey "0000FFFF"
git-ident-show
}
# Switch to alternative ident
git-ident-make-home() {
git config user.name "First Lnast"
git config user.email "my@email.com"
git config user.signingkey "AAAABBBB"
git-ident-show
}
# Switch to alternative ident
git-ident-make-cytopia() {
git config user.name "cytopia"
git config user.email "cytopia@everythingcli.org"
git config user.signingkey "695128A2"
git-ident-show
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment