Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to see the changes that my co-workers have made before I accept the incoming changes.

So I start by getting the status

svn st -u

...which tells me that I've got an incoming change

    *     9803   incomingChanges.html
M         9803   localChanges.html
M   *     9803   localAndIncoming.html

I can see what I've changed

svn diff localChanges.html

...but how can I diff localAndIncoming.html to show what has been changed, and how it's different than my working copy?

share|improve this question
Not an answer to your command line question, but: in the end, once you know what is different from your working copy, you'll probably want to merge the repository changes with your own changes. When using some GUI to do so, why not use a GUI to help you do the initial diff as well? Tools like TortoiseSVN offer such compare. Also, IDEs like Eclipse can make reviewing incoming changes (even when there's nothing to merge -- nice to get an idea of what your coworkers have been up to) very easy, avoiding automatic merges. – Arjan Jun 12 '10 at 12:08
Is there a GUI way of seeing incoming changes using TortoiseSVN? – Christian Dec 20 '10 at 14:48
You'd also want to diff incomingChanges.html as well, no? – Raffi Khatchadourian Sep 10 '13 at 20:59

I believe what you need is:

svn diff -rBASE:HEAD
share|improve this answer

FYI svn diff gives a diff based on the unmodified file stored in the .svn directory, not based on the live repo version.

You can run svn update to get subversion to attempt an update (and possibly merge) and then do an svn diff, but that's not as clean as I guess you want.

Finally svn diff does support diffing just on the repo. Example:

svn diff svn://svnserver/repo/localChanges.html -r REV_NO

Which defaults to comparing HEAD with the passed revision.

share|improve this answer

With tortoisesvn (if you use windows)

  • Invoke the log screen

  • Select head revision

  • Right click on localAndIncoming.html

  • Choose Compare with working copy

share|improve this answer

You really can't until you actually download the new version. Limitations like this were one of the big reasons why a new type of source control has become popular lately. It's called decentralized source control.
With this new form you have your own local repository, and you can then take changes from the main repository and run a diff on it, if you don't like the changes made you can revert your own repository and go from there.

And yeah, I know suggesting you switch products isn't an optimal solution, but it is a solution none the less.

share|improve this answer

Do another checkout in a fresh folder.

cd ..
svn checkout  /path/to/repo clean_working_copy

If you reuse clean_working_copy do not forget to update before

svn update clean_working_copy

Then compare your file with the one from clean_working_copy

diff your_working_copy/localAndIncoming.html clean_working_copy/localAndIncoming.html

Or with your prefered 3-way diff (mine is kdiff3)

kdiff3 --L1 Base --L2 theirs --L3 mine your_working_copy/.svn/text-base/localAndIncoming.html clean_working_copy/localAndIncoming.html your_working_copy/localAndIncoming.html
share|improve this answer
This work, but a scm should provide a more integrated way. – rds Oct 21 '11 at 9:34

I think

svn diff -r HEAD

almost gives what you want. The only thing is that the + and - are reversed relative to what you expect.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .