-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitconfig
47 lines (47 loc) · 1.57 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
[user]
name = "John, Doe"
email = "[email protected]"
[alias]
br = branch
ci = commit
cc = commit
# Get logs with oneline param, instead of git log -5 --oneline
# We can use <git lo 5> l - log and o - --oneline
lo = !sh -c 'git log -$1 --oneline' -
# When amending a commit the author and timestamp are reset to reflect
# recent change of the commit
ca = "commit --amend --reset-author"
canr = "commit --amend --no-edit --reset-author"
cane = "commit --amend --no-edit"
caned = "commit --amend --no-edit --date=now"
# When rewording a commit message, the author and timestamp are preserved
cw = "commit --amend --only --reedit-message=HEAD"
co = checkout
dd = diff
dw = "diff --word-diff=color"
ds = "diff --stat"
ls = "log --decorate --stat --abbrev-commit"
lt = "log --decorate --graph --abbrev-commit --pretty=oneline"
st = status
pf = "push --force"
# When creating a new branch, push the new branch automatically with the current branch name!
# Using functions
pn = "!f() { git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD); }; f"
pnf = "!f() { git push --force --set-upstream origin $(git rev-parse --abbrev-ref HEAD); }; f"
# Make vimdiff use ~/.vimrc when used from git
vimdiff = difftool -y -t vimdiff -R
[color]
ui = true
interactive = auto
[core]
autocrlf = false
safecrlf = false
editor = "vim -f"
[merge]
tool = "vimdiff"
# Set diff3 style to confict markers to show the orignial
conflictstyle = "diff3"
[push]
default = simple
[rebase]
autosquash = true