I have a bash script which I'm running with sudo: sudo NewScript
Inside the script, I have a git command which I don't want to run with sudo. Currently, since the entire script is run with sudo this command also runs with sudo and that's what I would like to suppress.
Is such thing possible or do I need to run the script without sudo and add sudo for every command inside the script other than the git command?
sudo, the script is run basically as if it was run by the root user. So the only solution I can think of is to run your git command with permissions of a specific user like so:sudo -S [username] [git command]sudorequired a password, you will be prompted for password for all such commands.