title: Fatal error "unsafe repository ('/home/repon' is owned by someone else)"
body: <p>I found an error log from Apache 2 that is fatal:</p>
  <pre class="lang-none prettyprint-override"><code>unsafe repository ('/home/repon' is owned by someone else)
  </code></pre>
  <p>It happens because I have <code>git rev-parse --symbolic-full-name --abbrev-ref HEAD'</code> in PHP code, and it looks like the <a href="https://github.blog/2022-04-12-git-security-vulnerability-announced/" rel="noreferrer">new Git safety change</a> no longer allows <code>www-data</code> to run this Git command.</p>
  <p>Running the following command does not work:</p>
  <pre class="lang-bash prettyprint-override"><code>git config --global --add safe.directory /homerepon
  </code></pre>
  <p>Is there a workaround to solve this issue?</p>
  <p>Git version: <code>2.35.3</code><br />
  PHP version: <code>7.4</code><br />
  Apache2 version: <code>2.4.41</code></p>