git: update config and add defaults for merging and rebasing

This commit is contained in:
2021-06-07 13:04:07 +02:00
parent 6351a7e5e3
commit 85fc766925
3 changed files with 70 additions and 46 deletions

View File

@ -4,7 +4,13 @@ git_user: your-username
git_email: your-email@example.com
git_signkey:
git_signingkey:
git_do_sign: false
git_merge_autostash: true
git_rebase_autostash: true
git_pull_rebase: true
git_pull_ff_only: true
git_default_branch: main
git_user_home: "/home/{{ git_system_user }}"
git_system_user: "{{ git_user }}"
@ -15,3 +21,5 @@ git_gpg_program: ~
git_aliases: []
git_credentials: []
git_config_preferred_editor: vim

View File

@ -1,30 +1,45 @@
# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
name = {{ git_user }}
email = {{ git_email }}
{% if git_do_sign %}
signkey = {{ git_signkey }}
signingkey = {{ git_signingkey }}
{% endif %}
# This is Git's per-user configuration file,
# this file is managed by ansible.
{% if git_do_sign %}
[gpg]
program = {{ git_gpg_program }}
{% endif %}
[commit]
[user]
name = "{{ git_author }}"
email = {{ git_email }}
{% if git_do_sign %}
signingkey = {{ git_signingkey }}
{% endif %}
[commit]
{% if git_do_sign %}
gpgsign = true
{% endif %}
[alias]
{% for alias in git_aliases %}
{{ alias.name }} = {{ alias.cmd }}
{{ alias.name }} = {{ alias.cmd }}
{% endfor %}
[pull]
rebase = {{ git_pull_rebase|bool|lower }}
{% if git_pull_ff_only|bool %}
ff = only
{% endif %}
[rebase]
autostash = {{ git_rebase_autostash|bool|lower }}
[merge]
autostash = {{ git_merge_autostash|bool|lower }}
[init]
defaultBranch = {{ git_default_branch }}
[core]
editor = {{ git_config_preferred_editor }}
{% for cred in git_credentials %}
[credential "{{ cred.remote_url }}"]
username = {{ cred.username }}