-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitconfig
More file actions
115 lines (90 loc) · 2.58 KB
/
.gitconfig
File metadata and controls
115 lines (90 loc) · 2.58 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
[user]
name = Your Name
[core]
#autocrlf = true # for windows ONLY
autocrlf = input # for linux and mac ONLY
editor = code --wait
excludesfile = ~/.gitignore_global
ignorecase = false
fileMode = false
[receive]
# denyCurrentBranch = warn # allow pushing, just warn
[alias]
unstage = reset HEAD
staged = diff --cached
track = checkout -t
ci = commit
st = status -sb
co = checkout
# verbose branch details
br = branch -v
# show a pretty log graph
lg = log --graph --pretty=oneline --abbrev-commit --decorate
# slight variation of pretty log graph
l = log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
# show files that have changed between two branches (git dbr master..branch)
dbr = diff --name-status
# show changed files for a commit
cf = show --pretty="format:" --name-only
# show what I did today
day = "!sh -c 'git log --reverse --no-merges --branches=* --date=local --after=\"yesterday 11:59PM\" --author=\"`git config --get user.name`\"'"
# stash short-cuts
sp = stash pop
sw = stash save
sl = stash list
sh = show --pretty="format:" --name-only
# show number of commits per contributor, sorted
count = shortlog -sn
# Other useful aliases:
undo = reset --soft HEAD~1
amend = commit --amend -C HEAD
# http://stackoverflow.com/a/10693888/11543
branch-by-date = for-each-ref --sort=-committerdate refs/heads/ --format='%(refname:short) %(committerdate:short) %(authorname)'
# http://stackoverflow.com/a/2514279
branch-by-dates = for k in `git branch | perl -pe s/^..//`; do echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k -- | head -n 1`\\t$k; done | sort -r
[apply]
whitespace = warn
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = auto
[color "branch"]
current = green bold
local = green
remote = red bold
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = green bold
changed = yellow bold
untracked = red
[color "sh"]
branch = yellow
[diff]
renames = copies
mnemonicprefix = true
[difftool]
prompt = false
[help]
autocorrect = 1
[status]
submodule = 1
[push]
default = current
[pack]
threads = 0
[rerere]
enabled = true
[commit]
template = ~/.git-commit-template
[init]
defaultBranch = main
[pull]
rebase = true
ff = only