-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_gitconfig
More file actions
46 lines (46 loc) · 1.52 KB
/
dot_gitconfig
File metadata and controls
46 lines (46 loc) · 1.52 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
[includeIf "gitdir:~/projects/work/**"]
path = ~/.config/git/work.gitconfig
[includeIf "gitdir:~/projects/personal/**"]
path = ~/.config/git/personal.gitconfig
[includeIf "gitdir:~/obsidian/**"]
path = ~/.config/git/personal.gitconfig
[includeIf "gitdir:~/.local/share/chezmoi/**"]
path = ~/.config/git/personal.gitconfig
[pull]
rebase = true
[rebase]
autoStash = true
[rerere]
enabled = true
[alias]
lg = "log --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=iso"
open-gh-pr = "!f() { \
xdg-open \"$(git ls-remote --get-url $(git config --get branch.$(git rev-parse --abbrev-ref HEAD).remote) \
| sed 's|git@github.com:\\(.*\\)$|https://github.com/\\1|' \
| sed 's|\\.git$||'; \
)/compare/$(\
git config --get branch.$(git rev-parse --abbrev-ref HEAD).merge | cut -d '/' -f 3- \
)?expand=1\"; \
}; f"
tidy = "!f() { \
git fetch --prune; \
branches=$(git branch -vv | grep \": gone]\" | awk \"{print \\$1}\" | grep -v \"^\\*$\"); \
if [ -z \"$branches\" ]; then \
echo \"No stale branches found.\"; \
return 0; \
fi; \
echo \"The following branches have missing upstreams:\"; \
echo \"$branches\" | sed \"s/^/ - /\"; \
echo \"\"; \
if [ \"$1\" = \"-f\" ] || [ \"$1\" = \"--force\" ]; then \
echo \"$branches\" | xargs git branch -D; \
else \
printf \"Delete these branches? [y/N] \"; \
read confirm; \
if [ \"$confirm\" = \"y\" ] || [ \"$confirm\" = \"Y\" ]; then \
echo \"$branches\" | xargs git branch -D; \
else \
echo \"Aborted.\"; \
fi; \
fi; \
}; f"