Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compare files between two branches in TortoiseSVN

I know how to do this in SVN,

svn diff http://svn.example.com/branches/A/File1.txt http://svn.example.com/branches/B/File1.txt

But there has to be a less painful way to do this in TortoiseSVN. You would think that you could do it from the Show Log, but it appears to only show revisions on the current branch.

like image 998
Kris Erickson Avatar asked Jan 13 '11 00:01

Kris Erickson


People also ask

How do I compare codes in svn?

Pick the two revisions you want to compare then use Context Menu → Compare Revisions. If you want to compare the same item in two different trees, for example the trunk and a branch, you can use the repository browser to open up both trees, select the file in both places, then use Context Menu → Compare Revisions.

What is the difference between svn and TortoiseSVN?

The main difference between SVN and TortoiseSVN is that the SVN is a distributed version control system while TortoiseSVN is an SVN client implemented as a Microsoft Windows shell extension. In brief, SVN is a version control system. On the other hand, TortoiseSVN is a Subversion client.

What does red exclamation mark mean in TortoiseSVN?

That means the Subversion status is normal. As soon as you start editing a file, the status changes to modified and the icon overlay then changes to a red exclamation mark. That way you can easily see which files were changed since you last updated your working copy and need to be committed.


2 Answers

  1. Go to the repository browser (<right click>/TortoiseSVN/Repo-browser/<enter URL>).
  2. Open right click menu on branch B, select 'Mark for comparison'.
  3. Then open right click menu on branch A, select 'Compare URLs' or 'Show differences as unified diff'.
like image 113
Antonio Pérez Avatar answered Oct 16 '22 15:10

Antonio Pérez


I don't know how new this feature is (I certainly read the documentation and didn't find it when I posted the question), but if you hold the Shift button down when you right click on a file, you can compare URLs without having to go to the repository browser.

See Difference to another branch/tag in the Viewing Differences documentation.

To illustrate:

Enter image description here

like image 68
Kris Erickson Avatar answered Oct 16 '22 15:10

Kris Erickson