title: Set git config values for all child folders
body: <p>I know that it's possible to set per-repo configs which override the user-level config (i.e. <code>/path/to/my/repo/.gitconfig</code> overrides <code>~/.gitconfig</code>). Is it possible to set git configs which override the user-level settings for all child folders of a given folder? I.e., I have</p>
  
  <pre><code>|--topLevelFolder1
  |--\
  |   ---.gitconfig_override
  |--\
  |   ---childFolder1
  |       \---[...]
  |--\
  |   ---childFolder2
  |       \---[...]
  </code></pre>
  
  <p>And I want the settings defined in <code>.gitconfig_override</code> to apply in <code>childFolder1</code> and <code>childFolder2</code>.</p>
  
  <p>My motivation for this is as follows: I have a work laptop which I also use in my spare time for personal projects. All my work code is nested within a single folder. When I push to work git repos, I need to do so with my work persona - work login instead of name, and work email. When I push to my own personal (github) repos, I want to do so with my real name and personal email.</p>
  
  <p>Other possible solutions I've thought of (and problems):</p>
  
  <ul>
  <li>Create separate users for "work" and "play", set their user-level settings appropriately, and log in as the appropriate user when I switch context (hassle, plus I could easily forget to switch)</li>
  <li>Create a script that searches for git repos inside "workFolder", and adds/updates their .gitconfig files to hold the appropriate details (if I create a repo and forget to run the script before pushing, I will push as the wrong person)</li>
  <li>"hack" git such that every time it creates a repo, it checks the filepath and, if appropriate, updates the .gitconfig file (complicated, messy, and almost certainly The Wrong Way To Do It - plus, I wouldn't have the first clue how to go about it!)</li>
  </ul>
  
  <p>I checked <a href="https://stackoverflow.com/questions/4220416/can-i-specify-multiple-users-for-myself-in-gitconfig">this question</a>, which only seems to contain solutions for single repos, not multiple. Hopefully someone will see this question who missed that one!</p>