-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
125 lines (96 loc) · 3.44 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
[user]
name = James Finstrom
email = [email protected]
#from https://github.com/gregschoen/awesome-git-config
[alias]
# short aliases
st = status
co = checkout
ci = commit
br = branch
df = diff
lg = log -p
rso = remote show origin
me = config user.name
up = !git update
smash = !git ir
unstage = reset HEAD
undo-commit = reset --soft HEAD^
# interactive rebase
ir = !sh -c 'git rebase -i origin/${1-master}' -
# log aliases
log-branch = log origin/master..
blog = !git log-branch
mlog = !git log --committer=\"`git me`\"
# update current branch
update = !sh -c 'git fetch origin && git rebase -p origin/${1-master}' -
# creates a diff of current branch against supplied branch, usage: git export-branch [refbranch]
branch-name = !git for-each-ref --format='%(refname:short)' `git symbolic-ref HEAD`
export-branch = !git format-patch --stdout $1 > ~/branches/`git branch-name`.diff
# all commits that aren't merges on all branches
all = !git log --pretty=oneline --abbrev-commit --all --no-merges
# all commits today for only me
today = !git all --since='12am' --committer=\"`git me`\"
# today's commits without formatting or paging
today-text = !git --no-pager today --no-color
# files different from master on current branch
fdm = !git diff origin/master... --name-status
# last commit info in svn style
last = !git show --name-status
last-files = !git last --pretty=format:""
# last commit only certain type of modification
mlast = !git last-files | awk 'match($1, /M/) {print $2}'
alast = !git last-files | awk 'match($1, /A/) {print $2}'
dlast = !git last-files | awk 'match($1, /D/) {print $2}'
# `git done`
# current branch: merge, push, non-forced delete branch, show info
done = !sh -c '~/bin/done -d $1' -
# `git publish`
# current branch: merge, push, show info
publish = !sh -c '~/bin/done $1' -
# `git lint`
# lints all .php files that are different between current branch and origin/master
lint = !sh -c '~/bin/lint'
# `git spawn my-new-branch`
# make new branch based on master no matter which branch is checked out
spawn = !sh -c 'git checkout -b $1 ${2-master} && git config branch.$1.localmerge ${2-master}' -
# `git nuke my-old-branch`
# (Checks out master and does a non-forced delete on the branch entered)
nuke = !git co master && sh -c 'git br -d $1' -
# `git sync`
# update current branch and master
sync = !git update && \
git co master && \
git pull && \
git co @{-1}
# `git save`
# saves a commit in current branch: local branches you will be rebasing
save = !git commit -am \"save game\"
# attempt to cleanup some common problems
unfuck = !git fsck && git remote prune origin && git gc
# find the top level of current repository
top = !git rev-parse --show-toplevel
# list files changed by last commit in absolute location
list = !git show --pretty=format:"" --name-only | sed '/^$/d' | sed \"s|^|`git top`/|g\"
# give a count of dirty files
dirty = !git status --porcelain -uno | wc -l
# number of non-merge commits
peeps = !git log --pretty=format:"%Cblue%aN%Creset" --no-merges | sort | uniq -c | sort -rn
mergers = !git log --pretty=format:"%Cred%aN%Creset" --merges | sort | uniq -c | sort -rn
# awesome placeholders
crunk = status
deploy = status
crazy = status
stupid = status
[color]
ui = auto
[core]
autocrlf = input
ignorecase = false
whitespace = cr-at-eol
editor = vim
pager = less -x4
[push]
default = matching
[help]
autocorrect = 1