remove sudo, run script instead as sudo
add git config