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!
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With