What is trunk, branch and tag in Subversion?

Possible Duplicate:
What do “branch”, “tag” and “trunk” really mean?

What is a trunk, branch and tag in Subversion and what are the best practices to use them?

  • Find changeset id parent of a branch in tfs
  • Script to merge 2 git branches automatically?
  • create a git repo for project skeleton
  • How to run git commands on remote without having local repo
  • How do I branch an individual file in SVN?
  • git branch, fork, fetch, merge, rebase and clone, what are the differences?
  • What tools can I use for Subversion in Visual Studio 2008?

  • Can SVN handle case sensitivity issues?
  • Could I use interactive proxy authentication with git-svn?
  • svn: How to revert somebody else's commit?
  • Ways to synch many (small) files over high-latency network connection
  • Keeping two files in sync between two repositories - symbolic links? or another way?
  • Good practice to use git together with svn
  • 9 Solutions collect form web for “What is trunk, branch and tag in Subversion?”

    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. Also, branches can be used to create development lines for multiple versions of the same product, like having a place to backport bugfixes into a stable release.

    Finally, tags are markers to highlight notable revisions in the history of the repository, usually things like “this was released as 1.0”.

    See the HTML version of “Version Control with Subversion”, especially Chapter 4: Branching and Merging or buy it in paper (e.g. from amazon) for an in-depth discussion of the technical details.

    As others (e.g. Peter Neubauer below) the underlying implementation as /tags /branches and /trunk directories is only conventional and not in any way enforced by the tools. Violating these conventions leads to confusion all around, as this breaks habits and expectations of others accessing the repository. Special care must be taken to avoid committing new changes into tags, which should be frozen.

    I use TortoiseSVN but no Visual Studio integration. I keep the “Check for modifications” dialog open on the second monitor the whole time, so I can track which files I have touched. But see the “Best SVN Tools” question, for more recommendations.

    The “trunk”, “branches”, and “tags” directories are conventions in Subversion. Subversion does not require you to have these directories nor assign special meaning to them. However, this convention is very common and, unless you have a really good reason, you should follow the convention. The book links that other readers have given describe the convention and how to use it.

    The answer by David Schmitt sums things up very well, but I think it is important to note that, to SVN, the terms ‘branch’, ‘tag’, and ‘trunk’ don’t mean anything. These terms are purely semantic and only affect the way we, as users of the system, treat those directories. One could easily name them ‘main’, ‘test’, and ‘releases.’; As long as everyone using the system understands how to use each section properly, it really doesn’t matter what they’re called.

    A great place to start learning about Subversion is http://svnbook.red-bean.com/.

    As far as Visual Studio tools are concerned, I like AnkhSVN, but I haven’t tried the VisualSVN plugin yet.

    VisualSVN does rely on TortoiseSVN, but TortoiseSVN is also a nice complement to Ankh IMHO.

    To use Subversion in Visual Studio 2008, install TortoiseSVN and AnkhSVN.

    TortoiseSVN is a really easy to use Revision control / version control / source control software for Windows.
    Since it’s not an integration for a specific IDE you can use it with whatever development tools you like.
    TortoiseSVN is free to use. You don’t need to get a loan or pay a full years salary to use it.

    AnkhSVN is a Subversion SourceControl Provider for Visual Studio. The software allows you to perform the most common version control operations directly from inside the Microsoft Visual Studio IDE. With AnkhSVN you no longer need to leave your IDE to perform tasks like viewing the status of your source code, updating your Subversion working copy and committing changes. You can even browse your repository and you can plug-in your favorite diff tool.

    A trunk is considered your main code base, a branch offshoot of the trunk. Like, you create a branch if you want to implement a new feature, but don’t want to affect the main trunk.

    TortoiseSVN has good documentation, and a great diff tool.

    I use Visual studio, and I use VisualSVN and TortoiseSVN.

    If you’re new to Subversion you may want to check out this post on SmashingMagazine.com, appropriately
    titled Ultimate Round-Up for Version Control with SubVersion.

    It covers getting started with SubVersion with links to tutorials, reference materials, & book suggestions.

    It covers tools (many are compatible windows), and it mentions AnkhSVN as a Visual Studio compatible plugin. The comments also mention VisualSVN as an alternative.

    A fantastic free utility to use if you have a team of developers is SVN Monitor. It serves as a heartbeat for your tree, telling you when there are updates, possible conflicts, etc. It’s not quite as useful for a solo developer though.

    A good book on Subversion is Pragmatic Version Control using Subversion where your question is explained, and it gives a lot more information.

    Git Baby is a git and github fan, let's start git clone.