SVN: How to create a new branch and clone the repository?

In this short post I will show you how to create a new branch in the SVN repository and how to make a copy of the main repository in your local branch.


What is trunk, branch and tag

The SVN repository (SubVersioN) consists of three main directories: Trunk, Branches and Tags. Trunk is the main branch, the project line, where all stable scripts go. Branches is a catalog where all side development lines of the project are stored, which we can implment to the main line. What does it mean? If you want to add any fix to the script located in the trunk directory, you should first create a branch, where you will keep the new version of the script until both branches are merged. Tags are mark of specific versions that allow us to restore them at any time.

Let’s do it!

We are creating a new branch:

svn mkdir "your url" -m "your comment"

Before adding new scripts or adding a new version of an existing file, copy the trunk content to your branch:

svn copy "your trunk url" "your branch url" -m "your comment"

If you enjoyed this post please add the comment below or share this post on your Facebook, Twitter, LinkedIn or another social media webpage.
Thanks in advanced!

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments