Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find difference between trunk and branch?

Tags:

diff

svn

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.

like image 849
Federer Avatar asked Feb 12 '10 09:02

Federer


People also ask

What is the difference between trunk and branch in git?

Trunk-based development (TBD) is a branching model for software development where developers merge every new feature, bug fix, or other code change to one central branch in the version control system. This branch is called “trunk”, “mainline”, or in Git, the “master branch”.

What is the difference between trunk and master?

Trunk-based development is a branching model that is also referred to as “mainline development.” All branches extend from one trunk/main branch, usually called the master branch. This persistent branch is where all developers commit. The master branch follows the evolution of a software project.

What is trunk and branch in SVN?

The trunk is the main line of development in a SVN repository. A branch is a side-line of development created to make larger, experimental or disrupting work without annoying users of the trunk version.


2 Answers

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.

like image 127
David Schmitt Avatar answered Oct 02 '22 21:10

David Schmitt


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

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

like image 28
Kanchan Srivastava Avatar answered Oct 02 '22 22:10

Kanchan Srivastava