-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathgitconfig
More file actions
119 lines (118 loc) · 6.24 KB
/
gitconfig
File metadata and controls
119 lines (118 loc) · 6.24 KB
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
# vim: set ft=gitconfig :
[user]
name = Larry Lv
email = larrylv1990@gmail.com
[github]
user = larrylv
[alias]
al = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\t=> \\2/' | sort
br = branch --format='%(if)%(HEAD)%(then)%(color:bold green)* %(refname:short)%(color:reset)%(else)%(if)%(worktreepath)%(then)%(color:normal)+ %(refname:short)%(color:reset)%(else) %(refname:short)%(end)%(end)'
bv = branch -vv --color
changes = diff --stat -r
# checkout a branch without typing its name by using fzf
cf = !git checkout $(git branch | fzf| tr -d '[:space:]' | tr -d '*')
ci = commit
ca = commit --amend
cleanup = "!git branch --no-color --merged | grep -v '\\*\\|master\\|develop' | xargs -n 1 git branch -d && git remote prune origin && git prune && :"
co = checkout
conflicts = diff --name-only --diff-filter=U
delete = !git ls-files -z --deleted | xargs -0 git rm
diffp = !"git --no-pager -c diff.noprefix=false diff --patch --no-color"
done = "!f() { current_branch=$(git rev-parse --abbrev-ref HEAD) || return $?; target_branch=master; git_dir=$(git rev-parse --git-dir) || return $?; case \"$git_dir\" in */.git/worktrees/*) worktree_name=$(basename \"$(dirname \"$(git rev-parse --show-toplevel)\")\") || return $?; resolved=0; for candidate in \"$worktree_name\" \"$worktree_name-branch\"; do if git show-ref --verify --quiet \"refs/heads/$candidate\"; then target_branch=$candidate; resolved=1; break; fi; done; if [ $resolved -ne 1 ] && [ \"$worktree_name\" = \"main\" ] && git show-ref --verify --quiet refs/heads/master; then target_branch=master; resolved=1; fi; if [ $resolved -ne 1 ]; then echo \"git done: unable to resolve worktree branch for '$worktree_name'\" >&2; return 1; fi;; esac; if [ \"$current_branch\" != \"$target_branch\" ]; then git checkout \"$target_branch\" || return $?; git branch -D \"$current_branch\"; else git branch -D @{-1}; fi; }; f"
files-since = "!git diff --name-only $(git merge-base HEAD $1) | xargs ls 2>/dev/null && :"
files-since-master = "!git files-since origin/master && :"
follow = log -n 10 --pretty=format:'%Cred%h%Creset %Cblue%an%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative --full-history --follow --
hide = update-index --assume-unchanged
ignored = !git ls-files -v | grep "^[[:lower:]]"
last = log -n 1 -p --color
# list all branches with their last commit
lb = for-each-ref --sort='-authordate:iso8601' --format='%(if)%(HEAD)%(then)* %(else) %(end)%(if)%(HEAD)%(then)%(color:red)%(refname:short)%(color:reset)%(else)%(color:cyan)%(refname:short)%(end)%(color:reset) - %(subject)%(color:green) %(align:16,left)(%(authordate:relative))%(color:reset)%(end)' refs/heads
# last 5 commits with changed files
lf = log --decorate --pretty=oneline --abbrev-commit --name-status --color -n 5
# last 10 commits without changed files
lg = log --pretty=format:'%Cred%H%Creset %Cblue%an%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --date=relative -n 10
ls-ignored = ls-files --exclude-standard --ignored --others
mf = merge --no-ff
news = log -p HEAD@{1}..HEAD@{0}
next = !git checkout `git rev-list HEAD..master | tail -1`
pb = pull --rebase
pick = cherry-pick
pl = pull
prev = checkout @^
ps = push
rbm = !sh -c 'git fetch origin && git rebase -i origin/master' -
rbu = !sh -c 'git fetch upstream && git rebase -i upstream/master' -
sb = show-branch
show-next = !git show `git rev-list HEAD..master | tail -1`
show-prev = !git show @^
st = status
uncommit = !git reset --soft HEAD^ && git reset HEAD .
unhide = update-index --no-assume-unchanged
unstage = reset HEAD .
# ss = stash save
# sl = stash list -p --color
# sp = status --porcelain
# standup = shortlog --since=yesterday
# svn-pb = svn rebase
# svn-ps = svn dcommit
# svn-pull = svn fetch
# svn-push = svn dcommit
# today = shortlog --since=midnight
# wdiff = diff --word-diff
who = shortlog -s -n --no-merges
[color]
ui = auto
diff = auto
status = auto
branch = auto
interactive = auto
[commit]
gpgsign = true
[core]
autocrlf = input
deltabasecachelimit = 4g
editor = vim
excludesfile = ~/.gitignore
fsmonitor = true
safecrlf = true
sshCommand = ssh -i ~/.ssh/id_rsa
pager = less -FRX
preloadindex = true
untrackedCache = true
whitespace = cr-at-eol
hooksPath = /Library/Application Support/OpenAI/Tools/PushPatrol/git-hooks
[diff]
compaction-heuristic = true
colorMoved = zebra
algorithm = patience
noprefix=true
[grep]
linenumber = true
[i18n]
commitEncoding = utf8
logOutputEncoding = utf8
[include]
path = .gitconfig.work
[merge]
tool = vimdiff
conflictstyle = diff3
summary = true
[pager]
diff = diff-so-fancy | less --tabs=1,5 -RFX
show = diff-so-fancy | less --tabs=1,5 -RFX
[push]
default = tracking
[pull]
rebase = true
# [url "git@github.com:"]
# insteadOf = https://github.com/
[safe]
directory = *
[lfs]
hooksPath = /Library/Application Support/OpenAI/Tools/PushPatrol/git-hooks/lfs
[credential "https://github.com"]
helper =
helper = !/opt/homebrew/bin/gh auth git-credential
[credential "https://gist.github.com"]
helper =
helper = !/opt/homebrew/bin/gh auth git-credential