Find difference between trunk and branch?

SvnDiff

Svn Problem Overview


Is there a way to find the differences between the trunk and say a branch 0.4.x?

I need to create a tag - however I can't remember if my latest corrections were done in the trunk or the branch.

Svn Solutions


Solution 1 - Svn

If you have a checkout of the repository at hand, you can use the ^ (caret, search for it in the manual) notation to reference the root of the repo like this:

svn diff --old ^/branches/0.4.x --new ^/trunk

This works since Subversion 1.6.

If you have an older subversion or no handy checkout of the repo, you can use absolute paths, as described in the original redbook:

svn diff --old http://.../repo/branches/0.4.x --new http://.../repo/trunk/

should give you the answer you're looking for.

Replace http://.../repo/ with the actual URL of your repository.

Solution 2 - Svn

svn diff ^/trunkUrl/fileName ^/branchUrl/fileName

This will give you the difference between a file in branch and trunk.

Solution 3 - Svn

You can use the meld tool for comparison instead of using command prompt to see the difference. It goes something like this.

svn diff --diff-cmd='meld' --old http://.../repo/branches/0.4.x --new http://.../repo/trunk/

Solution 4 - Svn

If you just want to diff against the current branch, you can just use a dot .

svn switch ^/branches/branchName
svn diff . ^/trunk

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
QuestionFedererView Question on Stackoverflow
Solution 1 - SvnDavid SchmittView Answer on Stackoverflow
Solution 2 - SvnKanchan SrivastavaView Answer on Stackoverflow
Solution 3 - SvnSumit PatilView Answer on Stackoverflow
Solution 4 - SvnJames McGuiganView Answer on Stackoverflow