-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitconfig
119 lines (102 loc) · 3.47 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
109
110
111
112
113
114
115
116
117
118
119
[user]
name =
email =
[color]
ui = auto
[alias]
# get current status
st = status
# add a commit
ci = commit
# display nicely git history
lg = log --graph --pretty=tformat:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%an %ar)%Creset'
# get last commit with a nice display
last = log --graph --pretty=tformat:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%an %ar)%Creset' -1
# see list of files modified, added
# in last commit
files = show --pretty=oneline --name-only
# take typo and keyboard errors into account
chekcout = checkout
fethc = fetch
plu = pull
psu = push
# shortcuts for very common command
co = checkout
cob = checkout -b
cp = cherry-pick
b = branch
bd = branch -d
bD = branch -D
ba = branch -a
bl = blame
undo = reset --hard
unadd = reset HEAD
pus = push
pul = pull
reb = rebase master
# pull, merge, push automatically
mergein = "!f() { git checkout $1 && git pull && git merge - --commit && git push && git checkout - ; }; f"
# handle amend without having to edit commit text
# for example: you forgot 1 file in your last commit
# just run git add yourfile and then git cam
cam = "!f() { git add --all && git commit --amend --no-edit; }; f"
# set upstream
setup = !git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD`
# see untracked files
lsf = ls-files --others
# set remote ssh
# example : git rem my-project
# where my-project is your remote repository https://bitbucket.org/beapi/my-project
rem = "!f() { git remote set-url origin [email protected]:beapi/$1.git; }; f"
# see ignored files
ignored = ls-files --others -i --exclude-standard
# run interactive rebase
order = "!f() { git rebase -i HEAD~$1; }; f"
# delete local & remote branch in the same time
nuke = !sh -c 'git branch -D $1 && git push origin :$1' -
# review before push
review-local = "!git lg @{push}.."
[core]
pager = cat
#
# Out of luck: on Windows w/o msysGit? You may have Notepad++…
# editor = 'C:/Program Files/Sublime Text 3/sublime_text.exe' -multiInst -notabbar -nosession -noPlugin
#
# If you want to use Sublime Text 2's subl wrapper:
# editor = subl -w
#
whitespace = -trailing-space
excludesfile = ~/.gitignore_global
ignorecase = false
[diff]
mnemonicPrefix = false
wordRegex = .
[fetch]
recurseSubmodules = on-demand
[grep]
extendedRegexp = true
[log]
abbrevCommit = true
[merge]
conflictStyle = diff3
[mergetool]
keepBackup = false
keepTemporaries = false
prompt = false
[rebase]
# this allows pull rebase even if your working tree is not clean
autoStash = true
[pull]
# This is GREAT… when you know what you're doing and are careful
# not to pull --no-rebase over a local line containing a true merge.
rebase = true
[push]
default = upstream
[rerere]
# If, like me, you like rerere, decomment these
# autoupdate = true
# enabled = true
[status]
submoduleSummary = true
[branch]
autosetuprebase = always