-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
executable file
·115 lines (96 loc) · 3.09 KB
/
.gitconfig
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
[core]
editor = code --wait
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
quotepath = false
autocrlf = input
# Make `git rebase` safer on macOS
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
trustctime = false
[color]
ui = auto
[diff]
tool = vscode
[difftool "vscode"]
cmd = code --wait --diff $LOCAL $REMOTE
[merge]
tool = vscode
[mergetool "vscode"]
cmd = code --wait $MERGED
[credential]
helper = osxkeychain
[fetch]
prune = true
[branch]
autosetuprebase = always
[user]
useconfigonly = true
[push]
default = simple
autoSetupRemote = true
[status]
showUntrackedFiles = all
[alias]
br = branch
c = !sh -c 'gh pr checks' -
ca = commit --amend
ci = commit
cl = lucky
cm = "!f() { git commit -m \"$*\"; }; f"
cf = fixup
co = checkout
f = fetch origin main:main
fr = rebase -i --autosquash main
fu = !git commit --fixup $(git rev-parse HEAD)
ico = "!git branch --sort=-committerdate | fzf | xargs -o git checkout"
ls = log --pretty=oneline --abbrev-commit --graph --decorate -n 10
o = !sh -c 'gh pr view --web' -
ra = rebase --abort
rc = rebase --continue
ri = rebase main -i
rs = rebase --skip
st = !git status -s && git diff --shortstat
w = which
aliases = !git config --get-regexp ^alias\\. | sed -e s/^alias\\.// -e s/\\ /\\ =\\ /
abort = checkout -- .
amend = commit --amend --no-edit
clean = "!f() { git branch --no-color --merged | grep -v '*' | xargs -n 1 git branch -d; }; f"
co-pr = !sh -c 'git fetch upstream pull/$1/head:pr/$1 && git checkout pr/$1' -
diff = diff --word-diff
fixup = "!git log -n 50 --pretty=format:'%h %s' --no-merges main..HEAD | fzf | cut -c -7 | xargs -o git commit --fixup"
force = push --force-with-lease
main = checkout main
pur = "!f() { if [ ! -z $(git remote | grep -E "^upstream$") ]; then git pur-upstream; else git pur-origin; fi }; f"
pur-upstream = pull upstream main --rebase --log --no-stat
pur-origin = pull origin main --rebase --log --no-stat
stsh = stash --keep-index
staash = stash --include-untracked
staaash = stash --all
standup = "!f() { for dir in ../*; do (echo "$dir" && cd "$dir" && git su); done; }; f"
su = !"git log --branches --since=$(if [[ "Mon" == "$(date +%a)" ]]; then echo "last friday"; else echo "yesterday"; fi) --author=$(git config --get user.email) --format=format:'%C(cyan)%>(14)%ar %C(yellow)%h %Creset %s'"
undo = reset --soft HEAD^
wait = reset HEAD
which = !git branch | grep -i
lucky = !sh -c 'git checkout $(git which $1 -m1)' -
[filter "media"]
clean = git media clean %f
smudge = git media smudge %f
required = true
[filter "hawser"]
clean = git hawser clean %f
smudge = git hawser smudge %f
required = true
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
[merge "npm-merge-driver"]
name = automatically merge npm lockfiles
driver = npx npm-merge-driver merge %A %O %B %P
# Personal config (default)
[include]
# For username / github token / etc
path = ~/.gitconfig.local
# Work config
[includeIf "gitdir:~/Work/"]
path = ~/.gitconfig.work