Sick of typing git commit --amend --author
because you've once again committed
work into a non-Github repo with your Github username and email?
Yeah me too. So I present to you Proteus.
Proteus is a simple tool to manage your various git configurations.
It reads a configuration file and applies the correct git configuration by matching rules which you have defined.
I haven't released a gem to RubyGems.org yet so you will need to build and install it from source at the moment.
Clone this repository:
git clone https://github.com/jgmchan/proteus.git
Build and install gem:
rake install
Proteus requires a YAML configuration file to be located at ~/.proteus.yaml. This file will describe the rules to match and the git configs to apply.
Sample ~/.proteus.yaml:
- rules:
remote_origin: github.com
config:
user.name: jgmchan
user.email: [email protected]
- rules:
remote_origin: git.example.com
config:
user.name: jeffrey
user.email: [email protected]
With the above configuration file, proteus will look at the remote origin of your git repository and if it matches 'github.com', it will change user.name to 'jgmchan' and user.email to '[email protected]'. If it matches 'git.example.com' it will change the user.name to 'jeffrey' and user.email to '[email protected]'.
To run proteus, go into your git repository and run:
proteus start
You can turn on logging by setting the environment variable PROTEUS_LOG to the required logging level:
PROTEUS_LOG=debug proteus start
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request