~stick/dotfiles

dotfiles/.gitconfig -rw-r--r-- 4.0 KiB
b4e8c01bStick bump 19 days ago
                                                                                
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
[include]
	path = safe/gitconfig
[includeIf "gitdir:~/work/"]
	path = safe/gitworkconfig
[core]
	autocrlf = input
	excludesfile = ~/.config/git/ignore
	hooksPath = ~/.config/git/hooks
	preloadindex = true
	untrackedCache = true
[credential]
	helper = cache --timeout=3600
[gc]
	auto = 256
[init]
	defaultBranch = main
[pager]
	branch = false
[pull]
	ff=only
[alias]
	# Add All
	AA = ! git add -A && git st
	# Amend Commit
	AC = commit --amend
	# Add Patches
	AP = ! git add -p && git st
	# Add Remote
	AR = remote add
	# Add Submodule
	AS = "!f(){ git submodule add -b $(git BH) $1 $2 && git submodule update --remote; }; f"
	# Add remote URL
	AU = remote set-url --add
	# Branch Here
	BH = rev-parse --abbrev-ref HEAD
	# BRanch
	BR = branch
	# Branch information, Verbose
	BV = branch -vv
	# Commit and write the message in Editor
	CE = commit
	# Commit with Message (requires message argument)
	CM = commit -m
	# CTags
	CT = ! .git/hooks/ctags
	# CLone
	CL = clone
	# CheckOut
	CO = checkout
	# Clone with Submodules
	CS = clone --recurse-submodules
	# Check Whitespace (http://peter.eisentraut.org/blog/2014/11/04/checking-whitespace-with-git/)
	CW = ! git diff-tree --check $(git hash-object -t tree /dev/null) HEAD
	# Delete Ignored
	DI = clean -dX
	# Delete Untracked
	DU = clean -d
	# Diff Whitespace
	DW = diff --check
	# Fetch All
	FA = fetch --all
	# Fire Drill
	FD = ! git add -A && git commit -m 'wip: fire drill!' && git push
	# Fetch all with Submodules
	FS = fetch --all --recurse-submodules
	# Last Commit
	LC = log -1 HEAD
	# Log Graph
	LG = log --graph \
		--date=format-local:'%Y.%m.%d %H:%M' \
		--pretty=format:'%C(yellow)%h%Creset %an %C(cyan)%ad%Creset%Cgreen%d%Creset %s'
	# List Ignored
	LI = ls-files --others -i --exclude-standard
	# Log with Signatures
	LS = log --graph \
		--date=format-local:'%Y.%m.%d %H:%M' \
		--pretty=format:'%C(yellow)%h%Creset [%G?] %an %C(cyan)%ad%Creset%Cgreen%d%Creset %s'
	# Main Branch
	MB = ! git checkout master || git checkout main
	# Push (Force)
	PF = ! git push -f origin $(git bh)
	# Pull Origin
	PO = ! git pull origin $(git bh)
	# PuSh
	PS = ! git push -u origin $(git bh)
	# Push to Top
	PT = ! git fa && git ro && git ps
	# Pull Upstream
	PU = ! git pull upstream $(git bh)
	# Pull (Recurse) (requires remote to pull from as argument)
	PR = "!f(){ git pull --recurse-submodules -r \"$1\" \"$(git bh)\"; }; f"
	# Repo Clean (removes a file or set of files from all commits in a repo)
	RC = "!f(){ git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch '\"$*\" --prune-empty --tag-name-filter cat -- --all && git for-each-ref --format='delete %(refname)' refs/original | git update-ref --stdin; git reflog expire --expire=now --all && git gc --prune=now; }; f"
	# Remove (Force)
	RF = "!f(){ git rm -rf \"$*\" && git status; }; f"
	# Rebase Interactively
	RI = rebase -i
	# Rebase Origin
	RO = "!f(){ git fetch origin && git rebase origin/master; }; f"
	# Rebase Upstream
	RU = "!f(){ git fetch upstream && git rebase upstream/master; }; f"
	# Remotes Verbose
	RV = remote -v
	# Stash Add
	SA = stash
	# Show Changes
	SC = diff --cached
	# Stash Pop
	SP = stash pop
	# SQuash
	SQ = ! git commit --squash=HEAD && git rebase --autosquash
	# Shrink Repo
	SR = ! git reflog expire --expire=now --all && git gc --prune=now --aggressive
	# Set up Submodules
	SS = submodule update --init --recursive --remote
	# STatus
	ST = status -sb
	# Submodule Update
	SU = submodule foreach --recursive 'git MB && git pull'
	# TableFlip (start over from whatever is in the remote)
	TF = "!f(){ read -r -p 'Throw it all away? [y/N]: ' -n 1 yn; printf '\n'; case $yn in [Yy]* ) git fetch --all --force --jobs 8 && git reset --hard origin/\"$(git rev-parse --abbrev-ref HEAD)\" && git clean -dfx; break;; * ) break;; esac; }; f"
	# Track Master (force local branch to track origin)
	TM = ! git branch -u origin/$(git BH)
	# Undo changes
	UC = clean -dfi
	# Un-stage
	US = reset HEAD --
[filter "lfs"]
	clean = git-lfs clean -- %f
	smudge = git-lfs smudge -- %f
	process = git-lfs filter-process
	required = true