-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
42 lines (34 loc) · 1.16 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
[user]
email = andreas.rau93@gmail.com
name = ndr
[init]
defaultBranch = main
[alias]
# Shortcuts
ch = checkout
br = branch
st = status
br = branch
cm = commit -m
po = push origin
# Soft reset last commit
soft = reset --soft HEAD~1
# Delete unstaged changes
hard = reset --hard
# info of last commit
last = log -1 HEAD
# More commands in one
aa = !git add -A && git status
cma = !git add -A && git commit -m
af = !git add -A && git commit --amend --no-edit
# Colored log
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
ls = log --pretty=format:"%C(yellow)%h\\ %C(green)%ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short --graph
# Remove gone branches (no longer on remote)
gone = "!f() { git fetch --all --prune; git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D; }; f"
# Branches sorted by last modified
bra = "!git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'"
# List Aliases
al = "!git config -l | grep alias | cut -c 7-"
[pull]
rebase = true