-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitconfig
92 lines (85 loc) · 2.68 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
83
84
85
86
87
88
89
90
91
92
[user]
name = Antonio Molinari
email = [email protected]
[github]
user = magnum
token = c07dbe54eafbe1620828fde02c13d8d7
[core]
excludesfile = /Users/magnum/.gitignore
filemode = false
editor = /usr/bin/vim
autocrlf = false
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[color]
ui = auto
[alias]
s = status -sb
d = diff
wd = diff --word-diff
a = add
cm = commit
ca = commit -a
co = checkout
rb = rebase
br = branch
ph = push
pl = pull
l = log --oneline --decorate
f = fetch
am = commit -a --amend
delete-remote = !sh -c \"git push \\$0 \\:\\$1\"
r = remote
rv = remote -v
aliases = git config --global alias.rv remote
report = "log [email protected] --since='2 sunday ago' --until='1 sunday ago' --format='%Cgreen%ci%Creset %s%Creset' --no-merges"
report-csv = "log [email protected] --since='2 sunday ago' --until='1 sunday ago' --format='\"%ci\",\"%s\"' --no-merges"
tree = log --graph --decorate --pretty=oneline --abbrev-commit --all
cam = commit -a -m
undo = reset --hard HEAD^
ignore = "{ curl -L -s https://www.gitignore.io/api/ >> .gitignore ;}; gi"
# Rebase workflow
# https://softwaredoug.com/blog/2022/11/09/idiot-proof-git-aliases.html?utm_source=tldrnewsletter
mainbranch = "!git remote show origin | sed -n '/HEAD branch/s/.*: //p'"
synced = "!git pull origin $(git mainbranch) --rebase"
update = "!git pull origin $(git rev-parse --abbrev-ref HEAD) --rebase"
squash = "!git rebase -v -i $(git mainbranch)"
publish = push origin HEAD --force-with-lease
pub = publish
[push]
default = matching
#http://tbaggery.com/2010/10/24/reduce-your-rails-schema-conflicts.html
[merge "railsschema"]
name = newer Rails schema version
driver = "ruby -e '\n\
system %(git), %(merge-file), %(--marker-size=%L), %(%A), %(%O), %(%B)\n\
b = File.read(%(%A))\n\
b.sub!(/^<+ .*\\nActiveRecord::Schema\\.define.:version => (\\d+). do\\n=+\\nActiveRecord::Schema\\.define.:version => (\\d+). do\\n>+ .*/) do\n\
%(ActiveRecord::Schema.define(:version => #{[$1, $2].max}) do)\n\
end\n\
File.open(%(%A), %(w)) {|f| f.write(b)}\n\
exit 1 if b.include?(%(<)*%L)'"
[log]
decorate = short
[filter "media"]
clean = git-media-clean %f
smudge = git-media-smudge %f
[merge]
ff = false
[credential]
helper = store
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[pull]
rebase = false
[init]
defaultBranch = main
[commit]
template = /Users/magnum/.stCommitMsg