-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.gitconfig
48 lines (48 loc) · 1.87 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
[alias]
alias = config --get-regexp alias
amend = !git add -p && git commit --amend --no-edit && git push --force-with-lease
bc = !git remote prune origin && git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -D
br = branch --all
c = !eval git commit -m \\'$@\\' && git push "#"
cl = !git clone --depth=1 $1 || git clone --depth=1 https://github.com/$1.git || git clone --depth=1 https://gitlab.com/$1.git "#"
co = checkout
cp = cherry-pick
force = push --force-with-lease
hard = !git reset --hard $([[ $1 -ne 0 ]] && echo HEAD~)$1 "#"
https = !git remote set-url origin $(git remote get-url origin | sed 's/^git@\\(.*\\):\\/*\\(.*\\)/https:\\/\\/\\1\\/\\2/')
lg = !git log --graph --abbrev-commit --pretty='%C(auto)%h %C(blue)%ad %C(green)%an %C(auto)%s' --date=human --color=always | fzf --ansi --no-sort --reverse --tiebreak=index
pl = !git pull --rebase --autostash --no-edit --recurse-submodules
ps = !git pl && git push
rename = !git checkout $1 && git branch -m $1 $2 && git push origin -u $2 && git push origin :$1 "#"
ssl = !git remote set-url origin $(git remote get-url origin | sed 's/^https:\\/\\/\\([^\\/]*\\)\\/\\(.*\\)/git@\\1\\:\\2/')
st = !git status --short --branch && git diff --stat && git log -4 --pretty='%C(auto)%h %C(blue)%ad %C(green)%an %C(auto)%s' --date=human
track = !git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD`
[core]
editor = vim
excludesfile = ~/.gitexcludes
hooksPath = ~/.githooks
symlink = true
fileMode = false
pager = delta --navigate
[diff]
colorMoved = default
[fetch]
prune = true
[help]
autocorrect = 1
[init]
defaultBranch = main
[interactive]
diffFilter = delta --color-only
[pull]
default = current
ff = only
[push]
default = current
followTags = true
[stash]
showPatch = true
[url "https://"]
insteadOf = git://
[include]
path = ~/.gitextra