-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitconfig
130 lines (111 loc) · 2.95 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
[core]
editor = vim
[user]
email = [email protected]
name = Ryan Huber
[help]
autocorrect = 1
[color]
color = auto
branch = auto
diff = auto
status = auto
ui = true
[alias]
br = branch
st = status
co = checkout
ci = commit
# +head+ shows the latest commit for the current branch
head = log -n1
# +cbranch+ returns the current branch you are on
cbranch = !"git branch | grep '*' | cut -f2 -d' '"
cm = !"git checkout master"
undo = !"git reset --hard HEAD"
undo-soft = !"git reset HEAD"
on = !"git checkout"
# +rbranch+ returns the remote branch for the current branch you are on assuming it
# is named the same
rbranch = !"git branch -r | grep -E \"/`git cbranch`$\" | grep -v -e \"->\""
# +recent+ returns the most recent branches you've been on
recent = "for-each-ref --count=25 --sort=-committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'"
short-recent = "for-each-ref --count=25 --sort=-committerdate refs/heads/ --format='%(refname:short)'"
squash = !"git rebase -i master"
switch = !"git checkout $(git short-recent | fzf)"
# +review+ shows changes in your local branch that its remote branch does not have
review = !"git log `git rbranch`..`git cbranch`"
# +pushup+ - pushes the current branch to the remote origin
pushup = !"git push --set-upstream origin `git cbranch`"
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
[push]
default = tracking
#[pull]
# rebase = true
#[rerere]
# enabled = 1
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustexitcode = true
[merge]
tool = Kaleidoscope
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[difftool]
prompt = false
[mergetool]
prompt = false
[diff]
tool = Kaleidoscope
[color]
pager = true
ui = auto
status = auto
diff = auto
branch = auto
showBranch = auto
interactive = auto
grep = auto
[color "status"]
header = black bold
branch = cyan
nobranch = red
unmerged = red
untracked = cyan
added = green
changed = red bold
[color "diff"]
meta = red bold
frag = black bold
func = blue
old = red strike
new = green
commit = blue
whitespace = red
context = normal
[color "branch"]
current = cyan
local = blue
remote = magenta
upstream = magenta
plain = normal
[color "decorate"]
branch = blue
remoteBranch = magenta
tag = magenta
stash = cyan
HEAD = blue
[color "interactive"]
prompt = red
header = red bold
error = red
help = black bold
[color "grep"]
context = normal
match = cyan
filename = blue
function = blue
selected = normal
separator = red bold
linenumber = normal
[init]
defaultBranch = main