Thursday, May 15, 2008

SVN Branches

Imagine working on a deployed project, and you want to add some new features and changes on the running copy.

Since making new features may cause problems in the deployed project, you need to have another copy from the application and work on it freely then merge it with the running copy to apply your changes.

Subversion makes this very easy, all you need to do is to create a new branch.

So, what is a branch?

in order to understand that, lets look at the repository location hierarichy, you will find that it is as follows
-- trunk
-- branches
  • trunk is the folder containing the version of the website currently deployed

  • branches is another folder containing some other versions, as a new edition of the application
Now, in order to do that, just run this command

svn copy ((repository-path))/((project-name))/trunk ((repository-path))/((project-name))/branches/((branch-name)) -m "Creating a private branch in order to ... bla bla bla"

now you are done with your branch, checkout the project from that new path, and do any changes you want freely then at the end merge with your trunk to apply your changes

No comments: