Command to get svn diff of current and previous revision number

SvnTortoisesvn

Svn Problem Overview


How can I get diff in file content of current and previous revision number by command line?

And how can I get previous revision number?

Svn Solutions


Solution 1 - Svn

svn diff -r HEAD <item> if you want to get the difference between your working copy and the last committed revision.

svn diff -r PREV:COMMITTED <item> if you want to see what the last commit did.

You should take look at Revision Keywords.

svn info <item> will give you (among other things) the last change revision for the item.

Solution 2 - Svn

As per your comments you'd like to see differences between the current and previous versions of an item that is not in your working copy. For that you need to know the item's URL (e.g. svn://[repo_root]/[path]/[item]) which I assume you do. Then you do the following:

svn info <item-URL>

will contain (among other things) the last change revision. With that revision number R you run:

svn diff -c <R> <item-URL>

and it will give you the last commit diff.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionPavan TiwariView Question on Stackoverflow
Solution 1 - SvnKonerakView Answer on Stackoverflow
Solution 2 - Svnmalenkiy_scotView Answer on Stackoverflow