-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
73 lines (72 loc) · 2.31 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
[url "https://"]
insteadOf = git://
[core]
autocrlf = input
editor = vim
eol = lf
pager = less
safecrlf = false
[alias]
ada = add -A
ap = add --patch
cm = commit
cma = commit --amend
co = checkout
cob = checkout -b
cobd = checkout -b develop
cod = checkout develop
com = checkout master
dryflush = clean -dnfx
feto = fetch origin
flush = clean -dfX
git = "!f() { git $@; }; f"
github = "!f() { git clone https://[email protected]/$1/$2; }; f"
l1 = log --oneline
mob = "!f() { git merge origin/`git rev-parse --abbrev-ref HEAD`; }; f"
mod = merge origin/develop
mom = merge origin/master
po = pull origin
pob = "!f() { git pull origin `git rev-parse --abbrev-ref HEAD`; }; f"
pod = pull origin develop
pom = pull origin master
pu = push origin
pub = "!f() { git push origin `git rev-parse --abbrev-ref HEAD` $@; }; f"
puf = "!f() { git push origin `git rev-parse --abbrev-ref HEAD` --force; }; f"
pur = "!f() { git pub; git pr; }; f"
pushy = push origin master
pussy = push origin develop
puta = push --tags
rba = rebase --abort
rbi = rebase -i
rbir = rebase -i --root
rbc = rebase --continue
rmo = remote add origin
rmrmo = remote rm origin
rmrmu = remote rm upstream
rmu = remote add upstream
rmv = remote -v
rp = reset --patch
rs = restore
taga = "!f() { git tag -a $1 -m '$1' $2; }; f"
tal = tag -l
st = status
sta = stash
stam = "!f() { git stash save '$@' }; f"
stal = stash list
stap = stash apply
stu = status -uno
sw = switch
pr = "!f() {\
remote=`git rmv | grep origin | grep push | awk '{print $2}'`;\
project=`echo $remote | awk -F/ '{ print $(NF-1) }'`;\
repo=`echo $remote | awk -F/ '{ print $NF }' | cut -d. -f1`;\
branch=`git rev-parse --abbrev-ref HEAD`;\
browser=chrome;\
case $1 in\
github | gh) start $browser https://github.com/$project/$repo/compare/$branch...develop?expand=1;;\
gitlab | gl) start $browser https://gitlab.com/$project/$repo/merge_requests/new?merge_request[source_branch]=$branch;;\
bitbucket | bb) start $browser https://bitbucket.org/$project/$repo/pull-requests/new;;\
echo) echo https://host:port/path/$project/$repo?branch=$branch;;\
*) start $browser https://github.com/$project/$repo/compare/$branch...develop?expand=1;;\
esac;\
}; f"