public
Last active

Fewer conflicts in your Rails apps

  • Download Gist
.gitattributes
1 2
Gemfile.lock merge=bundlelock
db/schema.rb merge=railsschema
.gitconfig
INI
1 2 3 4 5 6 7 8 9 10 11 12 13
[merge "bundlelock"]
name = bundle lock
driver = bundle lock
[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)'"

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.