Skip to content
/ karn Public
forked from prydonius/karn

Manage multiple Git identities

License

Notifications You must be signed in to change notification settings

seltzered/karn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

karn: Manage multiple Git identities with ease

Setup your Git repositories to always use a specific identity based on the directory tree.

With karn, you never have to manually change the local repository configuration to a different identity from your global.

karn will change your repository's local user.name and user.email configuration if necessary, but will never modify your global configuration.

Install

Pre-built binary

Head to the releases page to download pre-built binaries for OS X. Note that karn is currently only tested on OS X.

Go

You can install karn using Go with the following command:

go get github.com/prydonius/karn

Usage

karn can be used in two ways!

Automatically check for identity updates before running a Git command

Note: this method overrides the git command with a function that runs karn update before executing the original Git command. Run karn init to see exactly what the git command is overriden with

If you're okay with the scary warnings above, add the following line to your shell startup script (e.g. .bash_profile, .zshrc)

if which karn > /dev/null; then eval "$(karn init)"; fi

Run manually when you want to update

Alternatively, you can run karn update manually in a Git repository whenever you need to update your identity for that repository.

Configuring Identities

karn looks for a YAML configuration file in your home directory, ~/.karn.yml.

A sample configuration looks like this:

---
/Fun:
  name: Adnan Abdulhussein
  email: [email protected]
/Projects:
  name: Adnan A
  email: [email protected]

About

Manage multiple Git identities

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%