Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Since I'm a newbie to SVN, my question is a bit simple but before asking here, I did look at the official tutorial but the explanation in there did not give me any clue. So I hope I can find someone to simply them for me. Thanks in advance!

Here is my question: how do I use svn diff to see differences between a file in my repository and the file that I am currently working on? I mean, the file which is changed after the checkout but has not been added and committed yet.

I've found the commands:

diff [-c M | -r N[:M]] [TARGET[@REV]...]

diff [-r N[:M]] --old=OLD-TGT[@OLDREV] [--new=NEW-TGT[@NEWREV]] [PATH...]

diff OLD-URL[@OLDREV] NEW-URL[@NEWREV]

but I don't understand what target[@rev], [--new=NEW-TGT[@NEWREV]] [PATH...] etc. means.

Assume I checked out the file to /home/svn/myproject/test.c and made some changes on it .Now I want to check the one which is on repository and this one. How do I do that? Thanks in advance!

share|improve this question

1 Answer 1

up vote 2 down vote accepted

After making changes to a checked-out file, you can simply run

svn diff test.c

The -r and @rev are handy if you want to compare different versions of the file (older revisions). For example, to view the changes made between the two preceding revisions, use

svn diff -r PREV:HEAD test.c
share|improve this answer
    
thanks for explanation.I do not understand why the books do not write it like that! :) –  caesar Aug 14 '13 at 13:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.