-1

I have 4 different git repositories, one local and three deployed on Heroku.

I'm looking for a fast way to check differencies in the schema.rb file, in case a migration or db reset has been forgotten in any of the apps.

I assume that basing on the solution given in this SO question I would be able to fast check this difference? git diff ref1:path/to/file1 ref2:path/to/file2

I have named the remote repositories, i.e. remote_1, remote_2 etc.

I'm unsure though how to apply remote-names + path to get it right on Heroku, any advice on how the correct git command would look like with the above setup?

Community
  • 1
  • 1
Fellow Stranger
  • 32,129
  • 35
  • 168
  • 232
  • is the file path not the same? If so you may well do `git diff ref1 ref2 -- path/to/schema.rb` – Mykola Gurov Jan 14 '15 at 12:04
  • there is even an example in that answer! `git diff remotename/branchname:remote/path/file1.txt local/path/file1.txt` – phoet Jan 14 '15 at 12:15

1 Answers1

0

Compare remote repo with local:

git diff remote_1/master:db/schema.rb db/schema.rb

Compare remote repo with another remote:

git diff remote_1/master:db/schema.rb remote_2/master:db/schema.rb
Fellow Stranger
  • 32,129
  • 35
  • 168
  • 232