Git: Detected Dubious Repository Ownership

Tags
Git

While using an OpenProject managed repository one may encounter the following error:

fatal: detected dubious ownership in repository at '/var/db/openproject/git/myproject.git'
To add an exception for this directory, call:

       git config --global --add safe.directory /var/db/openproject/git/myproject.git

To resolve this issue for every repository, create a new file at /etc/gitconfig with the contents:

[safe]
       directory = *	

Note: Depending on the context, this error likely exists for a reason, so one should always proceed with caution. In my use case, using OpenProject to manage Git repositorie authentications via HTTPS, this was an acceptable course of action to take.