title: Separating the git credentials for two different git accounts
body: <p>I am using <code>Github</code> for the <em><strong>personal</strong></em> repositories and <code>GitLab</code> for the <em><strong>companies team</strong></em> repositories.</p>
  <p>Thanks to <a href="https://stackoverflow.com/questions/4220416/can-i-specify-multiple-users-for-myself-in-gitconfig">[1]</a> and <a href="https://stackoverflow.com/questions/35942754/how-to-save-username-and-password-in-git">[2]</a>, I was able to separate personal repositories with the work repositories (in the context of git account info) like below <code>gitconfig</code> script.</p>
  <p>However, I still couldn't separate the <strong><code>git credentials</code></strong>. Thus, I have to write ids and passwords every time they are required. Can someone help me separating the git credentials by the working directory for two different git accounts like the below config files?</p>
  <p><code>~/.gitconfig</code></p>
  <pre class="lang-sh prettyprint-override"><code>[user]
          email = personal@gmail.com
          name = My Name
  
  [includeIf &quot;gitdir:~/repositories/work/&quot;]
          path = ~/repositories/work/.gitconfig
  </code></pre>
  <p><code>~/repositories/work/.gitconfig</code></p>
  <pre class="lang-sh prettyprint-override"><code>[user]
          email = MyName@company.com
          name = My Name
  </code></pre>
  <p>p.s. My setting is git 2.25.x and Ubuntu 20.04.</p>