25

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!

1 Answer 1

32

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
Sign up to request clarification or add additional context in comments.

1 Comment

thanks for explanation.I do not understand why the books do not write it like that! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.