forked from anishathalye/dotfiles_template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitconfig
122 lines (93 loc) · 3.37 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
120
121
122
[user]
name = Joy Peterson
email = [email protected]
[core]
autocrlf = input
#safecrlf = warn
safecrlf = false
# editor = 'sublime_text' --wait --new-window
editor = 'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar
# preloadindex = true
# fscache = true
[gc]
# auto = 256
reflogExpire = 30 days
reflogexpireUnreachable = 3 days
[diff]
#tool=custom
external = ~/.git-cmd/my_diff.sh
[merge]
tool = kdiff3
[mergetool "p4merge"]
trustExitCode = true
keepBackup = false
[difftool]
prompt = false
[mergetool]
keepBackup = false
[difftool "tdiff"]
cmd = \""C:/Program Files/TortoiseGit/bin/TortoiseGitMerge.exe"\" -mine:"$REMOTE" -base:"$LOCAL"
trustExitCode = false
[mergetool "tmerge"]
cmd = \""c:/Program Files/TortoiseGit/bin/TortoiseGitMerge.exe"\" -base:"$BASE" -theirs:"$REMOTE" -mine:"$LOCAL" -merged:"$MERGED"
[difftool "custom"]
external = ~/.git-cmd/my_diff.sh
trustExitCode = false
[mergetool "kdiff3"]
trustExitCode = false
keepBackup = false
[color]
ui = true
[color "status"]
untracked = red normal bold
changed = red normal bold
[alias]
#list all aliases
la = "!git config -l | grep alias | cut -c 7-"
#assume aliases - Ignoring changes to files that are managed by git.
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
#show assumed files
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
#merges
ours = "!f() { git co --ours $@ && git add $@; }; f"
theirs = "!f() { git co --theirs $@ && git add $@; }; f"
# show all tags w/ one line of annotation
tags=tag -l -n1
# last 20 tags, lexicographic sort
ta = "!f() { git tags $@ | tail -20; }; f"
# See http://haacked.com/archive/2014/07/28/github-flow-aliases/
# and https://bitbucket.org/durdn/cfg/src/master/.gitconfig?at=master
co = checkout
cob = checkout -b
# Commit all code in current branch.
cm = !git add -A && git commit -m
# Modify the previous commit.
amend = commit -a --amend
# Edit global .gitconfig file.
ec = config --global -e
# Update working branch from master.
up = !git pull --prune $@ && git submodule update --init --recursive
# Throw away uncommitted work, but first commit in case you realize you need it later,
# then reset HEAD to before the commit. This allows the discarded work to be
# retrieved later if necessary.
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
# Condensed status
st = status -s
# follow file renames (mnemonic: 'log file' or 'log follow')
lf = log --decorate --follow
# short log form of last 10 commits, can override 10 w/ own count ('git lo -20' works)
lo = log -10 --decorate --pretty=tformat:"%ar%x09%C(yellow)%h%x09%Cgreen%d%Creset%x20%s"
l = log -10 --decorate --no-merges --pretty=tformat:"%ar%x09%C(yellow)%h%x09%Cgreen%d%Creset%x20%s"
lb = log -10 --decorate --first-parent --pretty=tformat:"%ar%x09%C(yellow)%h%x09%Cgreen%d%Creset%x20%s"
l1 = log --decorate -1
# diff HEAD-vs-working (all changes since last commit, regardless of staging status)
dh = diff --diff-filter=CMRUX HEAD
dn = diff --name-status
# list the files that changed in a changelist
changed = diff-tree --no-commit-id --name-only -r
[push]
default = simple
[rerere]
# remember how conflicts were resolved and automatically apply them in the futre.
enabled = true