tags:

views:

582

answers:

3

What is the SVN command to find the difference between two files on the hard disk (neither of which are in the repository)?

What is the command to find if one of the file is in a particular revision of SVN?

What are some of the cool things you do using SVN commands?

+9  A: 

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

diff file1 file2

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

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

svn info file

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

Nadia Alramli
+2  A: 

Answers:

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

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

    svn log filename@revnumber

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

svn log TestFile.txt@2

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

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

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

Lasse V. Karlsen
+2  A: 

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

Peter Parker
Timesaver, Tortoise...
Mario Ortegón