forked from lbesnard/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitconfig
62 lines (59 loc) · 2.25 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
[core]
editor = vim
#autocrlf = true
[user]
name = lbesnard
email = [email protected]
[credential]
helper = cache --timeout=36000
[color]
ui = auto
branch = auto
diff = auto
interactive = auto
status = 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
#
# http://haacked.com/archive/2014/07/28/github-flow-aliases/
[alias]
alias = !tac ~/.gitconfig | sed -e '/alias/q' |tac | tail -n+2
s = status
a = add
p = pull
b = branch
d = diff
l = log
co-wip = !git commit -m 'wip'
hash = !git log -1 --format=format:'%H'
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
co = checkout
com = !git checkout master && git pull && git bclean
co-wip-and-squash-last = !git co-wip && git squash-auto
squash-auto = !"f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f"
push-force-branch = !"f() { git branch | grep '*' | sed 's/* //g' | xargs git push -f origin; }; f"
push-branch = !"f() { git branch | grep '*' | sed 's/* //g' | xargs git push origin; }; f"
squash-last = !"f() { NL=$1; GIT_EDITOR=\"sed -i '2,$NL s/pick/squash/;/# This is the 2nd commit message:/,$ {d}'\"; git rebase -i HEAD~$NL; }; f"
ec = config --global -e
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
cob = checkout -b
cm = !git add -A && git commit -m
save = !git add -A && git commit -m 'SAVEPOINT'
wip = !git add -u && git commit -m "WIP"
undo = reset HEAD~1 --mixed
amend = commit -a --amend
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs -r git branch -d; }; f"
bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f"
reset-branch-like-remote = "!f() { branch=`git branch | grep '*' | sed 's/* //g'`; git fetch --all; git reset --hard origin/$branch; }; f"