GIT configuration using ansible

Hello Team,

I want to install git using ansible and try to configure using below commands.

git config --global user.name “Your Name” (Choose a proper name. Eg: surabhy.mr)
git config --global user.email “surabhymr@gmail.com

I am able to install GIT but unable to configure.

Are the global values not set, or are they set but not used? Wondering if --system would be more appropriate than --global. If you use --global, then it will set the values for whatever user Ansible is connecting as. This may or may not be the right user for later git usage.

–local is per- repository, --global is per-user (but may be overridden by --local), and --system is for everyone (but may be overridden by --global or --local).

You should be able to find out what is being set by inspecting the local, global and system locations after Ansible runs. I don’t know what they are in Windows, but for Linux they would be <repodir>/.git/config, ~/.gitconfig, and /etc/gitconfig respectively.

Regards, K.