title: Git not using user from Global Configuration file
body: <p>I am using Ubuntu 22.04 on AWS EC2, git version 2.34.1</p>
  <p>Below is my <code>~/.gitconfig</code> file:</p>
  <pre><code>[credential &quot;https://github.com&quot;]
          helper =
          helper = !/usr/bin/gh auth git-credential
  [credential &quot;https://gist.github.com&quot;]
          helper =
          helper = !/usr/bin/gh auth git-credential
  [safe]
          directory = /var/www/html/wix
          directory = /var/www/html/wix-native-app
  [user]
          name = JXX XXXha
          email = jXXXX0@gmail.com
          signingkey = 8XXXXXXXXXXX1
  [commit]
          gpgsign = true
  </code></pre>
  <p>However when I try to commit, I get below error:</p>
  <pre><code>ubuntu@ip-172-31-46-106:/var/www/html/wix-native-app$ sudo git commit
  Author identity unknown
  
  *** Please tell me who you are.
  
  Run
  
    git config --global user.email &quot;you@example.com&quot;
    git config --global user.name &quot;Your Name&quot;
  
  to set your account's default identity.
  Omit --global to set the identity only in this repository.
  
  fatal: no email was given and auto-detection is disabled
  </code></pre>
  <p>But as seen in my <code>.gitconfig</code> file, username and email are already set. Is there anything else to be done in configuration for commit to work?</p>