aboutsummaryrefslogtreecommitdiff
path: root/linux/home/.gitconfig
blob: 5d4e76066d12eb0b91a02c822f9a301bf01a9581 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
[user]
    name =
    email =

[init]
	defaultBranch = main

[color]
	ui = true

[alias]
    graph = log --oneline --graph --decorate
	ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
	ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
	lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
	conflicts = diff --name-only --diff-filter=U
	local-branches = !git branch -vv | cut -c 3- | awk '$3 !~/\\[/ { print $1 }'
	recent-branches = !git branch --sort=-committerdate | head
	authors = !git log --format='%aN <%aE>' | grep -v 'users.noreply.github.com' | sort -u --ignore-case
    sba ="!f() { git subtree add --prefix $2 $1 main; }; f"
    sbu ="!f() { git subtree pull --prefix $2 $1 main; }; f"
    stashrebase = "!f() { if [ \"$(git symbolic-ref --short HEAD)\" = \"main\" ]; then git stash save && git fetch && git rebase origin main && git stash apply; else git stash save && git fetch && git rebase origin master && git stash apply; fi; }; f"
    dotfiles = "!f() { git --git-dir=$HOME/.cfg --work-tree=$HOME stashrebase; }; f"


[credential "https://github.com"]
	helper =
	helper = !sh -c 'command -v gh >/dev/null 2>&1 && exec gh auth git-credential || exit 0'

[credential "https://gist.github.com"]
	helper =
	helper = !sh -c 'command -v gh >/dev/null 2>&1 && exec gh auth git-credential || exit 0'