[ACCEPTED]-Is there an SVN command to find the difference between two local files?-diff

Accepted answer
Score: 16

You don't use SVN to diff files that aren't 7 in the repository. If you are using linux 6 then use the command:

diff file1 file2

If you are using Windows 5 then try a tool like win merge for example

To find 4 information about a file in the repository 3 then use the command:

svn info file

If you want to find 2 out more about SVN, have a look at the official 1 tutorial.

Score: 12

svn diff --old foo.c --new bar.c


Score: 7

In TortoiseSVN you can diff two arbitrary 7 files. Just select them both and choose 6 diff in contextmenu of tortoiseSVN. However, they 5 have to be in same directory, otherwise 4 TSVN will not show up diff command. In this 3 case you can use helper tools TortoiseIDiff.exe and TortoiseMerge.exe which 2 are part of TortoiseSVN and are inside TSVN_installation/bin 1 folder

Score: 2


  1. There is none, SVN can compare between 20 repository versions for a target (ie. rev 19 1 and rev 3 of a particular file) or between 18 working copy version and last checked out 17 version, or working copy and repository 16 versions

  2. Depends on what you mean by that. If 15 the file has been added, you can check the 14 log for the file for the given revision, like 13 this:

    svn log filename@revnumber

for instance, check 12 the log of TestFile.txt in revision 2:

svn log TestFile.txt@2

if 11 it outputs a log, there was a file by that 10 name in revision 2, otherwise it wasn't.

However, that 9 won't tell you whether or not the file you 8 currently have in the working copy is the 7 same file as the one you checked the log 6 of (ie. if you deleted the file in an earlier 5 revision, and then added a new file with 4 the same name, it isn't the same file, lifetime-wise, but 3 it is a file with the same name in the same 2 location).

As for the third question, can 1 you be more specific?

Score: 0

Just a supplement for @Richard Kirby answer 8 as I can't comment for low reputation.

"svn 7 diff --old foo.c --new bar.c"

This command 6 works perfectly to make diff between two 5 local files. Except that, it could also 4 be used to compare the diff between two 3 files specified with SVN subversion URL. It 2 will be something like: svn diff --old https://repository/file1 --new 1 https://repository/file2

More Related questions