1. Type:
svn copy http://servername/svn/sandbox/trunk http://servername
/svn/sandbox/branches/mybranch -m "Created a branch"
and press Enter.
As with any other change to the repository, this results in the revision number being
incremented??”revisions are repository-wide.
We now have two choices for working with our branch: we can check it out into
another folder, or we can switch our current working copy to use it. Since we
already know how to do the former, we'll try out the latter.
2. Type svn switch http://servername/svn/sandbox/branches/mybranch
and press Enter.
We can confirm the switch has happened by using the info command again. Any
changes we make and commit will now be stored in our branch rather than the
trunk. Go ahead and make some.
Version Control 101
[ 70 ]
To switch or check out?
A good approach is to maintain two working copies of a project's trunk,
which we will call stable and unstable. We will never touch the stable
other than to update it or run/test the code. All changes are made in the
unstable copy, which we can either recreate every time we work on a new
branch or use switch to change to the branch we want.
This approach pays dividends when we are working with larger projects
where we may want to branch only a single folder or work with multiple
(non-conflicting) branches.
Pages:
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98