Compare latest changes in locally edited file with SVN copy of a file

svn diff <FILE>
If you have ever edited a locally checked out version of a file to tweak it for testing purposes, and came back to it over a weekend, you might have forgotten what you exactly changed. This command helps you see the differences between the the checked in SVN version, and the one you tweaked.
Sample Output
bbbco> /home/bbbco/selenium/tests/src/com/bbbco/standardtest>svn diff StandardTest.java 
200c200
<             sInterface.waitForPage(minTime);
---
>             sInterface.waitForPage(maxTime);
271c271
< }
\ No newline at end of file
---
> }

0
By: bbbco
2012-01-30 16:47:48

What Others Think

what about svn diff?
argherna · 358 weeks and 6 days ago
svn diff works across the board, against all files in the directory, right? this command lets you see the diff against one single file.
bbbco · 358 weeks and 6 days ago
I believe you can svn diff 1 file.
argherna · 358 weeks and 6 days ago
Hey hey, what do you know: svn diff <FILE> works just the same way. Unfortunately, the diff command is not listed in svn help which is what I always consult in reference to my svn commandlinefu. But, just goes to show what you learn if I just RTFM.
bbbco · 358 weeks and 6 days ago
Scratch that, apparently diff is listed, if I would just open my eyes. Thanks argherna for the tip!
bbbco · 358 weeks and 6 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

Considering A New Car?

You should consider a Tesla. Get 6 Months Free Supercharging.

Free Supercharging

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: