-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
58 lines (58 loc) · 2.08 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
[user]
name = J.Fukaya
email = [email protected]
[color]
branch = true
diff = true
interactive = true
status = true
ui = auto
[core]
editor = vim
excludesfile = ~/.gitignore_global
[rebase]
autosquash = true
[ghq]
root = ~/src
[alias]
co = checkout
ci = commit
st = status -s -b
br = branch
ad = add
l = log --stat
lp = log --pretty --graph
ll = log --oneline --left-right --graph
lll = log --graph --pretty=format:'%Cblue%h%Creset%d %Cgreen%an%Creset: %s %Cblue%ar%Creset'
rst = reset
pom = push origin master
# Diff
d = diff
dc = diff --cached
# Print current branch
cbr = rev-parse --abbrev-ref HEAD
# Create branch from origin/master after fetch
new = "!$SHELL -c \"git fetch && git checkout -b $1 origin/master\""
stock = "!$SHELL -c \"git checkout -b `date +%Y-%m-%d-%H-%M`-wip && git add . && git commit -m `date +%Y-%m-%d-%H-%M-wip`\""
# Checkout new branch from master
cob = "!$SHELL -c \"git checkout -b $1 master\""
# Delete all branch ignore master
brd = "!$SHELL -c \"git fetch; git branch --merge origin/${1} |grep -v '*'|grep -v \"origin/master\"|xargs git branch -d\""
delete-merged-branches = !"git branch --merged master | grep -v master | grep -v '*' | xargs git branch -d"
# Wip & Reverse wip
wip = "!$SHELL -c \"git add .;git commit -va -m '[wip]';\""
rwip = reset HEAD^
# Make pull reqeust
pr = "!$SHELL -c \"git push origin `git cbr`; hub pull-request -h ${1}:`git cbr` -b ${1}:${2};\""
# Display merge pull requests on master and production server
release = "!$SHELL -c \"git mergelog; echo '--------------'; git deployed;\""
# Create empty commit
tt = "!$SHELL -c \"git commit --allow-empty -m '$1'\""
# Branch time order
brt = "!$SHELL -c \"ls -tlr .git/refs/heads\""
# Deploy to heroku
hdeploy = "!$SHELL -c \"git fetch; git push heroku origin/master:master\""
brref = for-each-ref --sort='-*committerdate' --format="%(refname:short)" refs/heads/
# Etc....
fmerge = "!$SHELL -c \"git fetch; git merge origin/`git cbr`\""
pl = pull origin master:master