-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitconfig
82 lines (61 loc) · 2.7 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
80
81
82
[user]
name = Ted Naleid
email = [email protected]
[core]
excludesfile = ~/.gitignore
editor = vim
ignorecase = false
filemode = false
pager = delta
[alias]
st = status --short --branch
tags = !"git tag -l --format '%(tag) - %(taggerdate)' --sort=taggerdate"
branches = branch -avv
remotes = remote -v
amend = commit -a --amend --no-edit
addall = add -A :/
# one line per commit, ascii graph log showing history from current commit
l = log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%an]%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
# like above but shows history of all branches
la = !git l --all
# show just commits currently decorated by branch/tag pointers, really useful for high level picture
ld = !git l --all --simplify-by-decoration
default-branch="!git branch -l main master --format '%(refname:short)' | head -n1"
# create a new feature branch starting from origin/<main> that tracks it, and switch to it
nbm = !sh -c 'git checkout -B $(git config target.shortname)-$1 origin/$(git default-branch) && git branch -u origin/$(git default-branch) $(git config target.shortname)-$1' -
prom = !"git pull --rebase origin $(git default-branch)"
prpm = !"git pull --rebase prime $(git default-branch)"
dth1 = difftool HEAD~1
d = diff
dh1 = diff HEAD~1
# clickable http link to github repo
repourl=!"echo https://$(git remote get-url --push origin | sed 's/git\\@\\(.*\\)\\.git/\\1/' | sed 's/:/\\//')"
# push out a feature branch with a clickable link for creating a pull request against your upstream origin branch
pusho = !git push origin $(git branchname) && echo "create a pull request at: $(git repourl)/compare/$(git for-each-ref --format='%(upstream:lstrip=3)' $(git symbolic-ref -q HEAD) 2>/dev/null || echo $(git default-branch) | awk -F'/' '{print $NF}')...$(git branchname)?expand=1"
pushof = !git push -f origin $(git branchname) && echo "create a pull request at: $(git repourl)/compare/$(git for-each-ref --format='%(upstream:lstrip=3)' $(git symbolic-ref -q HEAD) 2>/dev/null || echo $(git default-branch) | awk -F'/' '{print $NF}')...$(git branchname)?expand=1"
[color]
diff = auto
status = auto
branch = auto
ui = always
[push]
default = simple
autoSetupRemote = true
[pull]
rebase = merges
[credential]
helper = osxkeychain
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true # use n and N to move between diff sections
dark = true # or light = true, or omit for auto-detection
[merge]
conflictstyle = zdiff3
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[init]
defaultBranch = main