Skip to content

Instantly share code, notes, and snippets.

@KevinColemanInc
Created January 25, 2021 15:25
Show Gist options
  • Save KevinColemanInc/cc5af665ccdc3eaccdc4f99eef65f646 to your computer and use it in GitHub Desktop.
Save KevinColemanInc/cc5af665ccdc3eaccdc4f99eef65f646 to your computer and use it in GitHub Desktop.
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[user]
name = Kevin Coleman
email = kevin.coleman@sparkstart.io
[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)'"
[core]
attributesfile = /Users/kevin/.gitattributes
excludesfile = /Users/kevin/.gitignore_global
hooksPath = ~/.git-templates/hooks
[alias]
lb = !git reflog show --pretty=format:'%gs ~ %gd' --date=relative | grep 'checkout:' | grep -oE '[^ ]+ ~ .*' | awk -F~ '!seen[$1]++' | head -n 10 | awk -F' ~ HEAD@{' '{printf(\" \\033[33m%s: \\033[37m %s\\033[0m\\n\", substr($2, 1, length($2)-1), $1)}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment