-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitconfig
50 lines (50 loc) · 2.1 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
[user]
name = Semih ERDOGAN
email = [email protected]
[github]
user = semiherdogan
[init]
defaultBranch = main
[core]
editor = vi
excludesfile = "~/dotfiles/gitignore_global"
autocrlf = input
[color]
ui = auto
[push]
autoSetupRemote = true
default = current
[pull]
rebase = false
[fetch]
prune = true
[alias]
s = status --show-stash
sb = s -sb
a = add
c = commit -m
p = pull
h = push
co = checkout
l = log --pretty='%C(yellow)%h %C(cyan)%cd %Cblue%aN%C(auto)%d %Creset%s' --date=relative --date-order
# l = !git log --pretty="%C(Yellow)%h %C(reset)%ad (%C(Green)%cr%C(reset))%x09 %C(Cyan)%an: %C(reset)%s" --date=short
b = !sh -c 'git -P branch -a'
wip = commit -am 'wip'
aliases = !sh -c 'git config -l | grep alias | cut -c 7-'
name-of-current-branch = symbolic-ref --short HEAD
forget = !git fetch -pq && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D
export = !git archive --format zip --output project.zip $(git name-of-current-branch)
unset-upstream = branch --unset-upstream
set-upstream = !git branch --set-upstream-to=origin/$(git name-of-current-branch) $(git rev-parse --abbrev-ref HEAD)
log1 = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
log2 = log --pretty=format:'%Cred|%Creset %<(12,trunc)%cr %Cred|%Creset %<(15,trunc)%aN %Cred|%Creset %<(50,trunc)%s %Cgreen|%Creset %h %Cgreen|%Creset %cd %Cgreen|%Creset' --abbrev-commit --date=format:'%Y-%m-%d %H:%M:%S'
reset-soft = reset --soft HEAD~1
reset-hard = reset --hard HEAD~1
nah = !git reset --hard && git clean -df
undo=reset --soft HEAD^
sortdiff = !sh -c 'git diff "$@" | grep "^[+-]" | sort --key=1.2 | uniq -u -s1'
new = !sh -c 'git log $1@{1}..$1@{0} "$@"'
latest-tag = !sh -c 'git fetch -pq && git describe --tags $(git rev-list --tags --max-count=1)'
worktree-skip = update-index --skip-worktree
worktree-no-skip = update-index --no-skip-worktree
worktree-skipped = !sh -c 'git ls-files -v | grep ^S'