What is the larger problem you are trying to solve? This sounds like you should have a script. You can always run as another user with su - someuser -c "/somecommand.sh". Alternatively, use sudo as it might be a better fit for your problem.
No. You could have a local wrapper for git that would add this behaviour in the path ahead of the normal tools, though, which might better achieve your goals.
su - someuser -c "/somecommand.sh". Alternatively, usesudoas it might be a better fit for your problem.