In english, please

This commit is contained in:
Alban Bronisz 2020-12-09 18:26:04 +00:00
parent a3005fc276
commit a4718158be
3 changed files with 41 additions and 29 deletions

View File

@ -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 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 git-start alban
Quand le job est fini: When job is done:
git-stop git-stop
Easy ! ;)
**Note:** Git-multi-user replaces git variable `include.path`.
Be carefull that it is not already used.
Pour l'installation de l'outil
==============================
Ajout dans le `~/.bashrc` :
# Pour l'outil git multi-utilisateurs
PATH=$PATH:/home/pi/outils/git-multi-user

View File

@ -1,24 +1,25 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu
if [ "$#" -ne 1 ]; then if [ "$#" -ne 1 ]; then
echo "Hey man, met ton nom !" echo "Hey man, give me your name !"
echo "Regarde, comme ça:" echo "See, like this:"
echo " $0 roberto" echo " $0 roberto"
exit exit
fi 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 if [ ! -f "$CONFIG" ]; then
echo "Ton fichier de configuration '$CONFIG' n'existe pas. :(" echo "Your configuration file '${CONFIG}' does not exist. :("
echo "Va voir dans le dossier ~/git" echo "Create it in '${ROOT_DIR}'"
exit exit
fi fi
git config --local include.path $CONFIG git config --local include.path $CONFIG
echo "La configuration est bien chargée: '$CONFIG'. Enjoy !" echo "Your git configuration '${CONFIG}' is well loaded. Enjoy !"
echo "Pour effacer la configuration, lancer:" echo "When job is done, don't forget to clean it:"
echo " git-stop" echo " git-stop"

View File

@ -1,6 +1,6 @@
[user] [user]
name = Alban Bronisz name = Alban Bronisz
email = alban.bronisz@probayes.com email = alban.bronisz@gmail.com
[push] [push]
default = simple default = simple
[alias] [alias]