343c9016ea37c06ddab90fac0c1abfe0bda4b8b6
Git.md
| ... | ... | @@ -92,6 +92,23 @@ A document explaining the internals of git (but also giving an introduction for |
| 92 | 92 | Guide for people that know how to use git, but want to learn something about the internals of git. |
| 93 | 93 | - Advanced Git topics by Atlassian: [https://www.atlassian.com/git/tutorials/advanced-overview](https://www.atlassian.com/git/tutorials/advanced-overview) |
| 94 | 94 | |
| 95 | +## Specific git config per directory |
|
| 96 | + |
|
| 97 | +In your directory, where you want to have a different git config (e.g. name and email), create a `.gitconfig`. For example like this: |
|
| 98 | + |
|
| 99 | +``` |
|
| 100 | +[user] |
|
| 101 | +user = Max Mustermann |
|
| 102 | +email = my_email@gmail.com |
|
| 103 | +``` |
|
| 104 | + |
|
| 105 | +In your `.gitconfig` in your user/home directory, add the following: |
|
| 106 | + |
|
| 107 | +``` |
|
| 108 | +[includeIf "gitdir:~/path/to/directory"] |
|
| 109 | + path = "~/path/to/directory/.gitconfig" |
|
| 110 | +``` |
|
| 111 | + |
|
| 95 | 112 | ## Specific commands |
| 96 | 113 | |
| 97 | 114 | The following is a list of some commands that are not part of the absolute basics, but worth knowing. |