-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitconfig
More file actions
136 lines (112 loc) · 3.11 KB
/
gitconfig
File metadata and controls
136 lines (112 loc) · 3.11 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# 'g<complete>' install via bashrc (eg: gl, gp, gs, gca, gals)
# use "!" to chain
[alias]
# Stage
a = add
# Help
als = "!git config -l | grep alias | cut -c 7-"
# Branch
bl = branch -va
b = checkout
bn = checkout -b
bdl = branch -d
bdr = push origin --delete
# Commit
c = commit
cm = commit -m
ca = !git add . && git commit -m
mend = commit --amend --no-edit #ugly if already pushed
# What's the difference between you and me?
d = diff
dl = !git diff HEAD^.. && git log -2
# Merge
m = merge
ms = merge --squash
# Reset
res = reset --hard #existing files
ref = checkout HEAD -- #one
rfs = clean -fd #rm new file
u = reset HEAD
clean = !git reset --hard && git clean -fd
# Status
s = status -s
l = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
la = !git log --all --decorate --oneline --graph
v = status -v -v
# Submodule
suir = !git submodule update --init --recursive
ps = !git pull && git suir
# Pull
pl = pull
# Push
p = push
pu = "!git push --set-upstream origin \"$(git rev-parse --abbrev-ref HEAD)\""
#end alias
# begin config
[push]
default = simple
# upstream - push the current branch to its upstream branch...
# simple - like upstream, but refuses to push if the upstream branch’s name is different from the local one...
# current - push the current branch to a branch of the same name.
#
# "simple" is the safe method. When pushing, push to the branch
# only if it already exists and is up to date with the latest commit(?).
##
## This can cause confusion for beginners:
## Say you create a new branch.
## If you create a local branch: 'git checkout -b branchname'
## Make a commit & push: 'git commit -m "msg" && git push'
###
### ex. git config push.default simple
### git push
###
### ...will fail to push because it doesn't have a previous record
### of any branches with your new branch name.
####
#### ** TL;DR you need to tell git to push your new branch up to github
#### ** see alias: "gpub"
[credential]
helper = cache --timeout=21600
[user]
email = 4b11b4@gmail.com
name = AB
[diff]
tool = kdiff3
#tool = meld
#tool = p4merge
[difftool]
prompt = false
[difftool "kdiff3"]
#[difftool "meld"]
#[difftool "p4merge"]
cmd = kdiff3 "$LOCAL" "$REMOTE"
#cmd = p4merge "$LOCAL" "$REMOTE"
#cmd = meld "$LOCAL" "$REMOTE"
keepTemporaries = false
trustExitCode = false
keepBackup = false
[merge]
tool = kdiff3
#tool = meld
#tool = p4merge
[mergetool]
prompt = false
[mergetool "kdiff3"]
#[mergetool "p4merge"]
#[mergetool "meld"]
cmd = kdiff3 "$BASE" "$LOCAL" "$REMOTE" -o "$MERGED" --qall
#cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED" #merged in middle
#cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED" #base in middle
#cmd = p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
keepTemporaries = false
trustExitCode = false
keepBackup = false
# Enforce SSH
[url "ssh://git@github.com/"]
insteadOf = https://github.com/
[url "ssh://git@gitlab.com/"]
insteadOf = https://gitlab.com/
[url "ssh://git@bitbucket.org/"]
insteadOf = https://bitbucket.org/
#[url "ssh://git@dev.azure.com/"]
# insteadOf = https://dev.azure.com/