diff --git a/git/config b/git/config new file mode 100644 index 0000000..91c8761 --- /dev/null +++ b/git/config @@ -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 diff --git a/git/ignore b/git/ignore new file mode 100644 index 0000000..fd36e61 --- /dev/null +++ b/git/ignore @@ -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 diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..0b55781 --- /dev/null +++ b/install.sh @@ -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" +