diff --git a/README.md b/README.md index 1d2ab55..00c5915 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,47 @@ -Je tente de faire des configurations Git différentes pour chacun d'entre nous +This lib permits to use different git users in the same session. -Installation -=========== +User just load its git configuration in a git repo. -Se créer un fichier de config (en pompant celui d'Alban par exemple) : + +Install +======= + +Add the path to your `~/.bashrc`: + + # Add git multi-user tool + PATH=$PATH:/path/to/git-multi-user + +One may need to run `source ~/.bashrc` to make it ready. + + + +Configuration +============= + +Create a config file (one can used Alban one as example): cp .gitconfig_alban .gitconfig_john -Modifier au moins `name` et `email`. +Modify at least `name` and `email`. -Utilisation -=========== +**Note:** It is better if the session does not have any git account. +I don't really dig up a mixed configuration. -Simple ! Les scripts sont normalement ajouter dans le $PATH -Dans le dépôt git où vous allez travailler : + +Usage +===== + +To start working in a git repo: git-start alban -Quand le job est fini: +When job is done: git-stop - - - -Pour l'installation de l'outil -============================== - -Ajout dans le `~/.bashrc` : - - # Pour l'outil git multi-utilisateurs - PATH=$PATH:/home/pi/outils/git-multi-user +Easy ! ;) +**Note:** Git-multi-user replaces git variable `include.path`. +Be carefull that it is not already used. diff --git a/git-start b/git-start index 88aa90c..b273d95 100755 --- a/git-start +++ b/git-start @@ -1,24 +1,25 @@ #!/usr/bin/env bash - +set -eu if [ "$#" -ne 1 ]; then - echo "Hey man, met ton nom !" - echo "Regarde, comme ça:" + echo "Hey man, give me your name !" + echo "See, like this:" echo " $0 roberto" exit fi -CONFIG="/home/pi/outils/git-multi-user/gitconfig_$1" +ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +CONFIG=${ROOT_DIR}"/gitconfig_$1" if [ ! -f "$CONFIG" ]; then - echo "Ton fichier de configuration '$CONFIG' n'existe pas. :(" - echo "Va voir dans le dossier ~/git" + echo "Your configuration file '${CONFIG}' does not exist. :(" + echo "Create it in '${ROOT_DIR}'" exit fi git config --local include.path $CONFIG -echo "La configuration est bien chargée: '$CONFIG'. Enjoy !" -echo "Pour effacer la configuration, lancer:" +echo "Your git configuration '${CONFIG}' is well loaded. Enjoy !" +echo "When job is done, don't forget to clean it:" echo " git-stop" diff --git a/gitconfig_alban b/gitconfig_alban index fadf5aa..57c57f2 100644 --- a/gitconfig_alban +++ b/gitconfig_alban @@ -1,6 +1,6 @@ [user] name = Alban Bronisz - email = alban.bronisz@probayes.com + email = alban.bronisz@gmail.com [push] default = simple [alias]