Add git config

This commit is contained in:
Alex 2024-02-16 14:07:15 +01:00
parent e7015a0322
commit d2fa51f684
Signed by: l-x
GPG key ID: 0B7107C9393169F4
3 changed files with 102 additions and 0 deletions

69
git/config Normal file
View file

@ -0,0 +1,69 @@
[alias]
f = flow
ff = flow feature
fr = flow release
b = branch
co = checkout
cb = checkout -b
where = branch -r --contains
show = show --show-signature
ci = commit
ciam = "!f() { BRANCH=`git branch --list | grep -E '\\*' | cut -d ' ' -f2`; MSG=\"($BRANCH) $1\"; git ci -am"\"$MSG\""; }; f"
cow = "!f() { git checkout "WE-$1"; }; f"
cbw = "!f() { git cb "WE-$1"; }; f"
amend = commit -a --amend
d = diff
ds = diff --shortstat
ls = log --pretty=format:"%C(yellow)%h%Cgreen%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --no-merges
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat --no-merges
unstage = reset HEAD --
cp = cherry-pick -s -x
s = status -sb
sl = stash list
sa = stash apply
sp = stash pop
ss = stash save
rba = rebase --abort
rbc = rebase --continue
unpushed = "log --branches --not --remotes --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
# clc = "!f() { git --no-pager ls -1; git --no-pager log --no-merges --pretty=format:'%h' -1 | xclip; }; f"
up = "!gitup"
ns = log staging..master --no-merges --oneline --color --pretty=format:"%C(yellow)%h%Cgreen%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
nr = log deployment..staging --no-merges --oneline --color --pretty=format:"%C(yellow)%h%Cgreen%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
purge-local-branches = "!f() { git cmp; git branch --merged | grep -vE 'master|staging|deployment|\\*' | xargs -n 1 git b -d; git co -;}; f"
appraise = !/bin/git-appraise
[user]
name = Alexander Wühr
signingKey = 0B7107C9393169F4
email = alex@pnyhf.eu
[push]
default = current
[core]
excludesfile = ~/.config/git/ignore
editor = vim
[commit]
gpgSign = true
[tag]
gpgSign = true
[init]
defaultBranch = main
[includeIf "gitdir:~/dev/scn/"]
path = ~/dev/scn/.gitconfig

18
git/ignore Normal file
View file

@ -0,0 +1,18 @@
dev/
.idea/
.keep
webgrind/
campaign-designer/
DefaultConfig.php
.env
.out
.mailmap
*.pid
*.code-workspace
.php-version
lsp/
.psalm.xml
GPUCache/
.todo
.yarn
.envrc

15
install.sh Executable file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -e
cd "$(dirname "${BASH_SOURCE}")"
CWD=$(pwd)
HOME="$CWD/home"
# git
mkdir -p "$HOME/.config/git"
ln -sf "$CWD/git/config" "$HOME/.config/git/config"
ln -sf "$CWD/git/ignore" "$HOME/.config/git/ignore"