Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using svn diff command

Tags:

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!

like image 472
caesar Avatar asked Aug 14 '13 12:08

caesar


People also ask

How do I view a specific revision in svn?

To find information about the history of a file or directory, use the svn log command. svn log will provide you with a record of who made changes to a file or directory, at what revision it changed, the time and date of that revision, and, if it was provided, the log message that accompanied the commit.

How do I view svn logs?

Examples. You can see the log messages for all the paths that changed in your working copy by running svn log from the top: $ svn log ------------------------------------------------------------------------ r20 | harry | 2003-01-17 22:56:19 -0600 (Fri, 17 Jan 2003) | 1 line Tweak.


1 Answers

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 
like image 93
choroba Avatar answered Sep 19 '22 16:09

choroba