I want to only allow the "git" userto be able to run git commands, I edited my sudoers file using
# Cmnd alias specification
Cmnd_Alias GIT_CMDS = /usr/bin/git
# User privilege specification
root ALL=(ALL:ALL) ALL
git ALL=(ALL) NOPASSWD: GIT_CMDS
"access right" might be different from "command execution right"
git could still be able to run git commands, but might not be able to update a folder not owned by git/git group.
That is why you have questions like "Allow User 'git' to run 'git pull' as '
www-data' via sudo", in order to allow
sudo -u www-data git <a command>
In your case, since you have specified
(ALL), check if your access error goes aways with the proper
sudo -u <auser> when you run commands as
git in a folder not owned by