-
Notifications
You must be signed in to change notification settings - Fork 23
/
gitconfig
108 lines (107 loc) · 3.55 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
[user]
name = Gabe Berke-Williams
email = gabe@thoughtbot.com
[core]
editor = `which vim`
whitespace=trailing-space,cr-at-eol
excludesfile = ~/.gitignore
autocrlf = false
[merge]
tool = opendiff
# Per @jferris: `ff = only` means Git will never implicitly do a merge commit, including while
# doing git pull. If I'm unexpectedly out of sync when I git pull, I get this
# message:
# fatal: Not possible to fast-forward, aborting.
# At that point, I know that I've forgotten to do something in my normal
# workflow, and I retrace my steps.
ff = only
[alias]
st = status -sb
# Delete branch locally and remotely
bd = !sh -c 'git branch -D $1 && git push origin :$1' -
co = checkout
# via http://andyjeffries.co.uk/articles/25-tips-for-intermediate-git-users
lol = log --pretty=oneline --abbrev-commit --graph --decorate
# Full commit messages without all the junk from `log --pretty=full`
full = log --pretty='%C(red)%H%nAuthor: %C(green)%an%n%C(magenta)%s%n%b'
# No color, short messages
basic = log --pretty='%h %s'
unstage = reset HEAD
done = !git fetch && git rebase origin/master && git checkout master && git merge @{-1} && bundle exec rake && git push
# Merge current branch into master, only if it's a fast-forward. Doesn't check
# out master if it's not a FF merge.
mm = !test `git rev-parse master` = $(git merge-base HEAD master) && git checkout master && git merge HEAD@{1} || echo "Non-fastforward"
#ff = merge --ff-only # commented out so I use `git mm`
up = !git fetch origin && git rebase origin/master
plre = pull --rebase
newauthor = commit --amend --reset-author -C HEAD
prune-remotes = remote prune origin
next = !git add . && git rebase --continue
current-branch = !git symbolic-ref HEAD | sed 's|refs/heads/||'
merged = branch -a --merged
# Typos
pul = pull
[format]
# git log uses --pretty format by default, so this changes the default
# format.
# 4436819 [23 hours ago] One line prompt <Gabe Berke-Williams>
pretty = %C(magenta reverse)%h%Creset %Cgreen[%cr]%Creset %s <%an>
[color]
# Color everything.
ui = auto
[color "branch"]
# What colors should "git branch" show?
# default black
current = yellow
# default yellow
local = green
# default red
remote = cyan
[color "diff"]
# Color syntax: <foreground> <background>
# So "normal red" is normal foreground, red background
# BUT bold is a modifier, so "bold green red" means
# "bold green" foreground, red background
whitespace = red reverse
plain = black
meta = cyan
frag = magenta bold
old = red
new = green
commit = yellow
[color "status"]
# Options:
# header: the header text of the status message
# added/updated: added but not committed
# changed: changed but not added in the index
# untracked
# nobranch: the color the "no branch" warning is shown in (default red)
added = yellow # files deleted with "git rm" are this color too
changed = green # deleted items NOT done with "git rm" are this color too
untracked = cyan
[help]
autocorrect = 1
[svn]
authorsfile = ~/.git-author
[instaweb]
httpd = webrick
# insteadOf lets you do `git clone gh:thoughtbot/dotfiles`
[url "git@heroku.com:"]
insteadOf = heroku:
[url "git://github.com/"]
# Read-only
insteadOf = gh:
[url "git@github.com:"]
# With write access
insteadOf = wgh:
[url "git@github.com:thoughtbot/"]
# thoughtbot, with write access
insteadOf = tb:
[push]
# Push current branch (and ONLY current branch) even if you've never pushed it
# before.
default = current
[rerere]
enabled = 1
[credential]
helper = osxkeychain