-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitconfig-mac
133 lines (132 loc) · 4.69 KB
/
gitconfig-mac
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
133
[user]
name = bokwoon
email = bokwoon.c@gmail.com
[credential]
helper = osxkeychain
[core]
excludesfile = ~/.gitignore
pager = less
editor = vim
[pull]
rebase = true
[diff]
tool = vimdiff
algorithm = patience
[difftool]
prompt = true
[commit]
verbose = true
[pager]
log = /usr/local/opt/git/share/git-core/contrib/diff-highlight/diff-highlight | less -RS
show = /usr/local/opt/git/share/git-core/contrib/diff-highlight/diff-highlight | less -RS
diff = /usr/local/opt/git/share/git-core/contrib/diff-highlight/diff-highlight | less -RS
[interactive]
diffFilter = /usr/local/opt/git/share/git-core/contrib/diff-highlight/diff-highlight
[alias]
l = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --reflog"
ll = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
acpush = "!acpush() {\
if [ $# -eq 0 ];\
then git add . && git commit -v && git push origin $(git branch | grep \\* | cut -d ' ' -f2);\
else git add . && git commit -v --message=\"$@\" && git push origin $(git branch | grep \\* | cut -d ' ' -f2);\
fi;\
}; acpush"
s = "status"
b = "branch"
ra = "reset ."
rs = "!rs() {\
git reset --soft HEAD~1 && git reset .;\
}; rs"
a = "add"
aa = "add ."
ap = "add -p"
c = "checkout"
cb = "checkout -b"
diffc = "diff --cached"
d = "difftool"
dc = "difftool --cached"
co = "commit"
aco = "!aco() {\
if [ $# -eq 0 ];\
then git add . && git commit -v;\
else git add . && git commit -vm \"$@\";\
fi;\
}; aco"
cpush = "!cpush() {\
git commit -v && git push origin $(git branch | grep \\* | cut -d ' ' -f2);\
}; cpush"
pullf = "!pullf() {\
git fetch --all && git reset --hard origin/$(git branch | grep \\* | cut -d ' ' -f2);\
}; pullf"
checkdangling = "fsck --unreachable --no-reflogs"
prunedangling = "!prunedangling() {\
git reflog expire --expire-unreachable=now --all;\
git gc --prune=now;\
}; prunedangling"
em = "!em() {\
[ -z $EDITOR ] && EDITOR='vim';\
$EDITOR $(git status --porcelain | awk '{print $2}');\
}; em"
ec = "!ec() {\
[ -z $EDITOR ] && EDITOR='vim';\
git diff --name-only | uniq | xargs $EDITOR;\
}; ec"
copyfile = "!copyfile() {\
git checkout $1 $2;\
git status;\
}; copyfile"
commits = "!commits() {\
if [ $# -eq 0 ];\
then git add . && git commit -v;\
else git add . && git commit -vm \"$@\";\
fi;\
}; commits"
commitpush = "!commitpush() {\
if [ $# -eq 0 ];\
then git add . && git commit -v && git push origin $(git branch | grep \\* | cut -d ' ' -f2);\
else git add . && git commit -v --message=\"$@\" && git push origin $(git branch | grep \\* | cut -d ' ' -f2);\
fi;\
}; commitpush"
somecommitpush = "!somecommitpush() {\
if [ $# -eq 0 ];\
then git commit -v && git push origin $(git branch | grep \\* | cut -d ' ' -f2);\
else git commit -v --message=\"$@\" && git push origin $(git branch | grep \\* | cut -d ' ' -f2);\
fi;\
}; somecommitpush"
fixpush = "!fixpush() {\
git reset --soft HEAD~1 && git reset .\
&& git stash --include-untracked\
&& git pull --rebase\
&& git stash pop;\
}; fixpush"
goto = "!goto() {\
git checkout $1 && git branch -f master HEAD && git checkout master;\
}; goto"
forcepull = "!forcepull() {\
git fetch --all && git reset --hard origin/$(git branch | grep \\* | cut -d ' ' -f2);\
}; forcepull"
forcepush = "git push -f"
undocommit = "!undocommit() {\
git reset --soft HEAD~1 && git reset .;\
}; undocommit"
pulll = "!pulll() {\
git stash --include-untracked && git pull --rebase && git stash pop;\
}; pulll"
stache = "stash --include-untracked"
unstache = "stash pop"
stachelist = "stash list"
stachedrop = "stash drop"
cheatsheet = "!\
echo ' s git status';\
echo ' l Shows the commit log';\
echo ' ';\
echo ' commits [msg] Make new commit with a message';\
echo ' commitpush [msg] Make new commit with a message & push to GitHub';\
echo ' pulll git pull without overwriting local files';\
echo ' ';\
echo ' goto [commit] Goto a particular commit';\
echo ' fixpush Fixes a failed push if you forgot to pull before pushing';\
echo ' forcepull Forcibly overwrite your repo with GitHubs repo';\
echo ' forcepush Forcibly overwrite Githubs repo with your repo';\
echo ' undocommit Undo your last commit from the git log';\
"