-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
55 lines (41 loc) · 1.66 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
[include]
path = ~/.gituser
[alias]
a = add
b = branch
c = commit
clean-pr = "!git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done"
clean-merged = "!git branch --merged | grep -v '\\*\\|main' | xargs -n 1 git branch -d"
ps = "!git checkout -q main && git for-each-ref refs/heads/ \"--format=%(refname:short)\" | while read branch; do mergeBase=$(git merge-base main $branch) && [[ $(git cherry main $(git commit-tree $(git rev-parse \"$branch^{tree}\") -p $mergeBase -m _)) == \"-\"* ]] && git branch -D $branch; done"
co = checkout
d = diff
lg = log --branches --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %C(bold)%s%Creset %Cgreen(%cr) %C(bold blue)<%an>' --abbrev-commit
# Check out a pull request from GitHub as a branch named "pr/<Number>"
pr = "!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
# Matches its acronym: 'pull upstream master'
pum = "!git pull upstream master"
# Create and track a branch on origin with same name as current local branch
puo = "!git rev-parse --abbrev-ref HEAD | xargs -n 1 git push -u origin"
s = status
[color]
diff = auto
status = auto
branch = auto
[core]
excludesfile = ~/.gitignore
# Make `git rebase` safer on OS X
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
trustctime = false
[credential]
helper = osxkeychain
[init]
defaultBranch = main
[pager]
branch = false
[push]
default = simple
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true