forked from jetm/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
76 lines (57 loc) · 2.02 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
[user]
name = Javier Tia
email = [email protected]
[core]
pager = less -FRsX
editor = vim
autocrlf = input
safecrlf = true
[color]
ui = auto
[i18n]
commitencoding = UTF-8
logoutputencoding = UTF-8
[merge]
stat = true
diff = vimdiff
[help]
# Automatically correct and execute mistyped commands
autocorrect = 1
[alias]
br = branch
ci = commit
co = checkout
st = status
ls = ls-files
rb = rebase
dc = diff --cached
# cherry-pick
cp = cherry-pick -x
# Logs
# lgn = "!f() { git log --graph --pretty=format:'%Cred%H%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --date=relative $@ | git name-rev --stdin --name-only ; } ; f"
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
# To see what new commits have been created by the last command
# (typically after a "git pull"), e.g.: git new ORIGIN/BRANCH
new = !sh -c 'git log $1@{1}..$1@{0} "$@"'
# Editing/adding conflicted files
# edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; vim `f`"
# add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
# While the empty tree sha1 4b825dc642cb6eb9a060e54bf8d69288fbee4904
# is known to git, you may need to generate it.
# git diff --check $(git empty-tree-sha1)
# empty-tree-sha1 = hash-object -t tree /dev/null
# Un-apply a Stash
stash-unapply = '!git stash show -p | git apply -R'
# remove remote-tracking branches that were deleted from the remote repo
# trim = !git remote prune origin && git gc
# search and replace text in all repo: git search-replace old_name new-new
search-replace = "!f() { git grep --null --full-name --name-only -e \"$1\" -- . | xargs -0 perl -i -p -e \"s/$1/$2/g\"; }; f $1 $2"
[push]
default = simple
[pull]
rebase = true
[branch]
autosetuprebase = always
[diff]
algorithm = patience