-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitconfig
More file actions
99 lines (71 loc) · 3.48 KB
/
Copy pathgitconfig
File metadata and controls
99 lines (71 loc) · 3.48 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
[user]
name = Ted Naleid
email = contact@naleid.com
[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"
# Show local branches that have been merged into default branch
prune-preview = !sh -c 'git branch --merged "$(git default-branch)" | grep -v "^\\*" | grep -v "$(git default-branch)"' -
# Delete local branches that have been merged into default branch
prune-merged = !sh -c 'git branch --merged "$(git default-branch)" | grep -v "^\\*" | grep -v "$(git default-branch)" | xargs -r git branch -d' -
# Show branches where remote tracking branch is gone (likely merged via squash)
gone-preview = !git fetch --prune && git branch -vv | grep ': gone]' | awk '{print $1}'
# Delete branches where remote tracking branch is gone
gone-prune = !git fetch --prune && git branch -vv | grep ': gone]' | awk '{print $1}' | xargs -r git branch -D
# create a new feature branch starting from origin/<main> that tracks it, and switch to it
nbm = !sh -c 'git checkout -B $1 origin/$(git default-branch) && git branch -u origin/$(git default-branch) $1' -
prom = !"git pull --rebase origin $(git default-branch)"
prpm = !"git pull --rebase prime $(git default-branch)"
d = diff
dh1 = diff HEAD~1
dom = !git diff "origin/$(git default-branch)"
# 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 branch --show-current) && 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 branch --show-current)?expand=1"
pushof = !git push -f origin $(git branch --show-current) && 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 branch --show-current)?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
[include]
path = ~/.gitconfig.local