~stick/dotfiles

ref: 734262a2baa28829c955b7f9bbead269d85e4202 dotfiles/.gitconfig -rw-r--r-- 3.5 KiB
734262a2Stick update copyright for 2020 6 months 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
[user]
	name = Stick
	email = stick@stma.is
	signingkey = 0A3BAF89EFE25F0D55C5571DEC1B22A58EEB3DFC
[core]
	autocrlf = input
	excludesfile = ~/dotfiles/gitignore
	preloadindex = true
	untrackedCache = true
[commit]
	gpgsign = true
[credential]
	helper = cache --timeout=3600
[gc]
	auto = 256
[init]
	templatedir = ~/dotfiles/git_template
[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 = "!f(){ git branch --no-color | grep "\\*" | cut -f2 -d' '; }; f"
	# BRanch
	BR = branch
	# 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 --oneline --all
	# List Ignored
	LI = ls-files --others -i --exclude-standard
	# Push (Force)
	PF = ! git push -f origin "$(git bh)"
	# Pull Origin
	PO = ! git pull origin "$(git bh)"
	# PuSh
	PS = ! git push || 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 checkout master && 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 --