-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
33 lines (29 loc) · 1.63 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
[user]
name = Your Name
email = Your Email
[alias]
co = checkout
ci = commit
br = branch
amend = commit --amend
st = status
ll = log --pretty=oneline --decorate --graph --all
l = log --pretty=oneline --decorate
lp = log --pretty=format:'%Cred%h%Creset %C(yellow)%d%Creset %s %Cgreen(%cd)%Creset' --abbrev-commit --date=rfc
lpu = log --pretty=format:'%Cred%h%Creset %C(yellow)%d%Creset %s %Cgreen(%cr)%Creset - %C(magenta)%cn%Creset' --graph --abbrev-commit --date=relative
lpn = log --pretty=format:'%Cred%h%Creset %C(yellow)%d%Creset %s %Cgreen(%cr)%Creset - %C(magenta)%cn%Creset' --abbrev-commit --date=relative -n
lpd = log --pretty=format:'%Cgreen%cd%Creset %Cred%h%Creset %C(yellow)%d%Creset %s' --abbrev-commit --date=short
# find commits that changed a file: git his <filepath> (Examples of commits that modify a file (helps in understanding what needs to be changed))
his = log --follow --color=always --date=format:'%d %b, %Y' --pretty=format:'(%Cgreen%h%Creset)[%ad] %C(blue bold)%s%Creset'
# search code in commit history: git wot :function_name:filepath (See how a function evolved)
wot = log --date=format:'%d %b, %Y' --pretty='%n%C(yellow bold)📅️ %ad%Creset by (%C(green bold)%an%Creset) %C(cyan bold)%h%Creset' --graph -L
# top 10 most edited files (most actively edited files)
top10 = ! git log --pretty=format: --name-only | sort | uniq -c | sort -rg | head -10
# top n most edited files: git top 20
top = ! git log --pretty=format: --name-only | sort | uniq -c | sort -rg | head -n
[merge]
tool = vscode
[mergetool "vscode"]
cmd = code --wait $MERGED
[core]
editor = code --wait