I couldn't properly follow the other answers, here's more of a dummies guide...
You can do this either way round to go trunk -> branch
or branch -> trunk
. I always first do trunk -> branch
fix any conflicts there and then merge branch -> trunk
.
Merge trunk into a branch / tag
- Checkout the branch / tag
- Right-click on the root of the branch | Tortoise SVN | Merge ...
- Merge Type: Merge a range of revisions | Click 'Next'

- Merge revision range: Select the URL of the trunk directory that you copied to the branch / tag. Enter the revisions to merge or leave the field empty to merge all revisions | click 'Next'

- Merge options: I just left these as default | click 'Merge'

- This will merge the revisions into the checked out branch / tag
- Then commit the merged changes to the branch / tag
How do you create a new project/repository?
A git repository is simply a directory containing a special .git
directory.
This is different from "centralised" version-control systems (like subversion), where a "repository" is hosted on a remote server, which you checkout
into a "working copy" directory. With git, your working copy is the repository.
Simply run git init
in the directory which contains the files you wish to track.
For example,
cd ~/code/project001/
git init
This creates a .git
(hidden) folder in the current directory.
To make a new project, run git init
with an additional argument (the name of the directory to be created):
git init project002
(This is equivalent to: mkdir project002 && cd project002 && git init)
To check if the current current path is within a git repository, simply run git status
- if it's not a repository, it will report "fatal: Not a git repository"
You could also list the .git
directory, and check it contains files/directories similar to the following:
$ ls .git
HEAD config hooks/ objects/
branches/ description info/ refs/
If for whatever reason you wish to "de-git" a repository (you wish to stop using git to track that project). Simply remove the .git
directory at the base level of the repository.
cd ~/code/project001/
rm -rf .git/
Caution: This will destroy all revision history, all your tags, everything git has done. It will not touch the "current" files (the files you can currently see), but previous changes, deleted files and so on will be unrecoverable!
Best Solution
For svn, a branch is just another directory, with the little difference that it knows some history: It knows where it was copied from. When you merge a branch into the trunk, Subversion will take all changes that where made to the branch since it was created (i.e. copied) and apply all those changes to the trunk. It will remember which changes have already been merged (so it's not totally true that Subversion doesn't store anything about the merges), hence knows not to apply them again.
So, merging in Subversion doesn't mean much more than applying some changes here that were made somewhere else. The idea of the branch graph therefore doesn't work well with Subversion (and the way of handling branches is probably the most often uttered criticism of Subversion).
If you have the choice, you might want to look at Mercurial, which has a usability quite similar to that of Subversion, but is much better at handling branches and merges.
If you're stuck with subversion, I hope I could at least give a little explanation. Also, the SVN Book is a very good introduction to Subversion and is definitely a must-read for new Subversion users.