git_config
Add, replace, or remove Git configuration values
Collection: community.general
Full Name: community.general.git_config
Synopsis
Add, replace, or remove Git configuration values
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| name | string | yes | Configuration setting to manage | |
| repo | string | Repository directory; required for local scope | ||
| file | string | Configuration file; required for file scope | ||
| scope | string | system | Configuration scope: system, global, local, or file | |
| state | string | present | Whether the setting should be present or absent | |
| value | string | Nonempty configuration value required when state is present | ||
| add_mode | string | replace-all | Use replace-all to replace values or add to preserve other values |
Example
yaml
- name: Configure a repository's author email
community.general.git_config:
scope: local
repo: /srv/project
name: user.email
value: automation@example.org