toansible: Add git installation

This commit is contained in:
flyingscorpio@clevo 2022-02-22 13:48:35 +01:00
parent 3ad81ae8ae
commit 3459a67850
3 changed files with 24 additions and 11 deletions

View file

@ -29,17 +29,6 @@ git:
- . ./secrets &&
git config --global user.name "${USER}@$(uname -n)";
git config --global user.email "$GIT_EMAIL";
git config --global pull.rebase false;
git config --global alias.br "branch";
git config --global alias.ci "commit";
git config --global alias.co "checkout";
git config --global alias.cp "cherry-pick";
git config --global alias.st "status";
git config --global alias.logadog "log --all --decorate --oneline --graph";
git config --global alias.chlog "log --no-merges --oneline --stat @{1}..";
git config --global alias.df "diff --word-diff=color";
git config --global diff.tool vimdiff;
git config --global init.defaultBranch "main"
etckeeper:
- install:

View file

@ -18,3 +18,9 @@
copy:
src: ignore
dest: ~/.config/git/ignore
- name: Copy global gitconfig
template:
src: gitconfig.j2
dest: ~/.gitconfig
backup: true

View file

@ -0,0 +1,18 @@
[user]
name = {{ ansible_facts['env']['USER'] }}@{{ ansible_hostname }}
email = {{ git_email }}
[pull]
rebase = false
[alias]
br = branch
ci = commit
co = checkout
cp = cherry-pick
st = status
logadog = log --all --decorate --oneline --graph
chlog = log --no-merges --oneline --stat @{1}..
df = diff --word-diff=color
[diff]
tool = vimdiff
[init]
defaultBranch = main