Description: Ubuntu 22.04.1 LTS
Release: 22.04
I'm trying to cron some git commands under the user www-data
and it doesn't work.
To troubleshoot, I tried to run sudo -u www-data git show
but it returns fatal: detected dubious ownership in repository
If I run sudo -u www-data git diff --shortstat
it returns warning: Not a git repository. Use --no-index to compare two paths outside a working tree
I also tried adding into sudoers
www-data ALL=(ALL) NOPASSWD: /usr/bin/git show
# and also
www-data ALL=(ALL) NOPASSWD: /usr/bin/git
Still getting the same errors. Any ideas why? Thank you.