Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

If the files you want to compare are in your working copy, you can use simply diff as pointed by the others, however if the files are in some revision you can specify a revision for each file

git diff <revision_1>:<file_1> <revision_2>:<file_2> 

as noted here: http://stackoverflow.com/a/3343506/1815446https://stackoverflow.com/a/3343506/1815446

In your case (specifying the same revision for both files):

git diff <revisionX>:fileA.php <revisionX>:fileB.php 

If the files you want to compare are in your working copy, you can use simply diff as pointed by the others, however if the files are in some revision you can specify a revision for each file

git diff <revision_1>:<file_1> <revision_2>:<file_2> 

as noted here: http://stackoverflow.com/a/3343506/1815446

In your case (specifying the same revision for both files):

git diff <revisionX>:fileA.php <revisionX>:fileB.php 

If the files you want to compare are in your working copy, you can use simply diff as pointed by the others, however if the files are in some revision you can specify a revision for each file

git diff <revision_1>:<file_1> <revision_2>:<file_2> 

as noted here: https://stackoverflow.com/a/3343506/1815446

In your case (specifying the same revision for both files):

git diff <revisionX>:fileA.php <revisionX>:fileB.php 
Source Link
Pau Fracés
  • 1.2k
  • 11
  • 24

If the files you want to compare are in your working copy, you can use simply diff as pointed by the others, however if the files are in some revision you can specify a revision for each file

git diff <revision_1>:<file_1> <revision_2>:<file_2> 

as noted here: http://stackoverflow.com/a/3343506/1815446

In your case (specifying the same revision for both files):

git diff <revisionX>:fileA.php <revisionX>:fileB.php