Skip to content

Commit

Permalink
add basic git configuration role
Browse files Browse the repository at this point in the history
  • Loading branch information
awojasinski committed Jan 7, 2024
1 parent 1a2bd7e commit e104738
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
13 changes: 13 additions & 0 deletions roles/git/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
- name: "Git | set init.defaultBranch"
community.general.git_config:
name: init.defaultBranch
scope: global
value: main

- name: "Git | set aliases"
community.general.git_config:
name: alias.{{ item.alias }}
scope: global
value: "{{ item.command }}"
loop: "{{ git_aliases }}"
16 changes: 16 additions & 0 deletions roles/git/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
git_aliases:
- alias: p
command: push
- alias: pf
command: push --force
- alias: ll
command: log --oneline
- alias: ca
command: commit --amend --no-edit
- alias: cm
command: commit -sm
- alias: df
command: diff --name-only
- alias: list
command: config --get-regexp ^alias

0 comments on commit e104738

Please sign in to comment.