-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
79 lines (60 loc) · 1.84 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
[user]
email = [email protected]
name = Gaiaz Iusipov
[url "[email protected]:gaiaz-iusipov"]
insteadOf = "https://github.com/gaiaz-iusipov"
[core]
excludesfile = ~/.gitignore
editor = nano
[init]
templatedir = ~/.git-templates
defaultBranch = main
[diff]
tool = meld
[difftool]
prompt = false
[push]
default = simple
[help]
autocorrect = 20
[alias]
# Shortcuts
co = checkout
sw = switch
ci = commit
st = status
br = branch --show-current
# Useful commands
prev = checkout -
amend = commit --amend --no-edit
pushf = push --force
please = push --force-with-lease
unstage = reset HEAD --
last = log -1 HEAD
free = branch -D
fall = fetch --all --prune
poll = pull --all --prune
# Push Origin
puor = !git push -u origin $(git branch --show-current)
# Tree-like log graph
hist = log --graph --abbrev-commit --decorate --all --format=format:\"%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(dim white) - %an%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n %C(white)%s%C(reset)\"
# List branches sorted by last modified
brls = "!git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)%09%(upstream:track)' refs/heads | sed -e 's-refs/heads/--'"
# Remove tracking branches no longer on remote
brcl = "!for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == \"[gone]\" {sub(\"refs/heads/\", \"\", $1); print $1}'); do git free $branch; done"
# Unpushed branches
unpushed = log --branches --not --remotes
# Multialias
repush = !git add . && git amend && git please
clear = !git clean -df && git co -- .
# External commands
aliases = !git config -l | grep alias | cut -c 7-
# Reset origin HEAD
return = reset ORIG_HEAD
refuse = reset --hard HEAD
undo = reset --soft HEAD^
back = reset HEAD^1 --hard
[pull]
rebase = false
[includeIf "gitdir/i:~/work/**"]
path = ~/work/.gitconfig