# GIT configuration using ansible

**URL:** <https://forum.ansible.com/t/git-configuration-using-ansible/33661>\
**Category:** Ansible Project\
**Created:** [August 24, 2020, 5:55am UTC](https://forum.ansible.com/t/git-configuration-using-ansible/33661 "2020-08-24T05:55:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![surabhy\_vaishakh](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@surabhy\_vaishakh](https://forum.ansible.com/u/surabhy_vaishakh)\
**Post date:** [August 24, 2020, 5:55am UTC](https://forum.ansible.com/t/git-configuration-using-ansible/33661/1 "2020-08-24T05:55:17Z")

</div>

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](mailto:surabhymr@gmail.com)”

I am able to install GIT but unable to configure.

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [August 24, 2020, 6:17am UTC](https://forum.ansible.com/t/git-configuration-using-ansible/33661/2 "2020-08-24T06:17:06Z")

</div>

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.
