-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitconfig
More file actions
99 lines (98 loc) · 4 KB
/
gitconfig
File metadata and controls
99 lines (98 loc) · 4 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
[user]
name = Saimon Moore
email = saimon.moore@xing.com
[color]
status = auto
diff = auto
branch = auto
interactive = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[core]
autocrlf = input
editor = vim
[apply]
whitespace = nowarn
[help]
autocorrect = 1
[branch]
autosetupmerge = true
autosetuprebase = always
[push]
default = simple
[alias]
l = log
ld = log --oneline --decorate
sh = show
st = status
sts = status -sb
ci = commit -v
cif = commit -v --fixup HEAD
reba = rebase -i --autosquash
co = checkout
br = branch
df = diff
dfc = diff --cached
cp = cherry-pick
cur = "rev-parse --abbrev-ref HEAD"
gh-pullr = "!f() { git cur ; }; google-chrome https://github.com/teambox/Teambox-hosted/pull/new/teambox:develop...teambox:`f`"
gh-commits = "!f() { git cur ; }; google-chrome https://github.com/teambox/Teambox-hosted/commits/`f`"
rm = "!f() { git status | grep deleted | awk '{print $3}' | xargs git rm}; f"
t = log --graph --all --oneline --decorate
history = "!f() { echo \"==============> ADDED\" >> HISTORY.md; git log --pretty=format:\"%ai %s [%an]\" >> HISTORY.md; }; f"
unstage = reset HEAD
update = "!f() { git remote update && git pull --rebase --recurse-submodules; }; f"
first = "!git rev-list master |tail -n 1"
last = "rev-parse HEAD"
mod = "!f() { git status | grep modified | awk '{print $3}' | head -n 5; }; f"
# Pretty!
# via http://andyjeffries.co.uk/articles/25-tips-for-intermediate-git-users
lol = log --pretty=oneline --abbrev-commit --graph --decorate
# Not yet added - doesn't include ignored files
unstaged = ls-files --others --exclude-standard
# Files that are in the staging area
added = diff --cached --name-only
today = log --stat --since='1 Day Ago' --graph --pretty=oneline --abbrev-commit --date=relative
ff = merge --ff-only
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
sha = rev-parse HEAD
latestb = for-each-ref --sort=-committerdate refs/heads/
cichangelog = "!f() { git commit --allow-empty -m \"* $1\"; }; f"
back = checkout @{-1}
recent = !git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/ | grep -v develop | head -n 20
fixup = "!f() { git commit --fixup=$1; git rebase -i --autosquash $1~1; }; f"
fixit = "!f() { git commit --fixup=$1; GIT_SEQUENCE_EDITOR=: git rebase -i --autosquash $1~1; }; f"
down-on-it = rebase origin/develop
wip = !git add --all . && git commit -m 'WIP'
pushf= push --force-with-lease
# Welcome to pam/fzf heaven
pam= !BRANCH=`git recent | fzf` && git checkout ${BRANCH}
pamadd= !FILES=`git status -s | awk '{ print $2 }' | fzf -x -m` && git add --all ${FILES}
pamfix= !HASH=`git log --pretty=oneline | head | fzf` && git fixit `echo ${HASH} | awk '{ print $1 }'`
pamshow= !HASH=`git log --pretty=oneline | head | fzf` && git show `echo ${HASH} | awk '{ print $1 }'`
pamlog= !HASH=`git log --pretty=oneline | head | fzf` && echo ${HASH} | awk '{ print $1 }' | xargs echo -n | pbcopy
pamrebase= !HASH=`git log --pretty=oneline | head -n 50 | fzf` && git rebase -i `echo ${HASH} | awk '{ print $1 }'`^
pamvim= !FILES=`git status -s | awk '{ print $2 }' | fzf -x -m` && vim ${FILES}
pamgrep= !sh -c 'FILES=`git grep -l -A 0 -B 0 $1 $2 | fzf -x -m` && vim `echo ${FILES} | cut -d':' -f1 | xargs`' -
pamvimlog= !HASH=`git log --pretty=oneline | head -n 50 | fzf` && HASHZ=`echo ${HASH} | awk '{ print $1 }'` && FILES=`git show --pretty='format:' --name-only $HASHZ | fzf -x -m` && vim ${FILES}
pamreset= !HASH=`git log --pretty=oneline | head -n 50 | fzf` && git reset --soft `echo ${HASH} | awk '{ print $1 }'`^
[push]
default = upstream
[rerere]
enabled = true
[merge "gemfilelock"]
name = relocks the gemfile.lock
driver = bundle install
[rebase]
autosquash = true