How to compare file with two different git remotes

I want to compare the file (main_controller.rb) with two different remotes (namely, production and production), since I had a different behavior during production and production.

I believe the code (i.e. the file) is the same, but just wanted to be sure. But I can not figure out how to make this comparison in git.

Any help would be appreciated.

+3
source share
1 answer

Do you have both remotes configured in the same repo? I assume that you will do this, and that they are called productionand staging. There is a way to refer to a file in a specific commit / tree file, and the syntax is treeish:path/to/file. You should use this with git diffto say something like

git diff production:path/to/file staging:path/to/file
+4
source

Source: https://habr.com/ru/post/1783516/


All Articles