diff --git a/src/dev/tools/git.md b/src/dev/tools/git.md index 1fe25e0..f455b8d 100644 --- a/src/dev/tools/git.md +++ b/src/dev/tools/git.md @@ -25,3 +25,20 @@ git commit --ammend --no-edit ```shell git rev-parse HEAD | xclip ``` + +## Conditional Git configuration + +Since git 2.13, there is an option to include configuration (or not) based on a condition + +Here is an example use case + +```txt +# Specific configurations for work and personnal repos +[includeIf "gitdir:~/code/work/"] + path = .gitconfig.work +[includeIf "gitdir:~/code/oss/"] + path = .gitconfig.oss +``` + +If include, settings in any configuration found file provided by the path +parameter will by append to or will overide current configuration.