Re: +AFs-OT+AF0- Working with version control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Lynch wrote:
> On Thu, September 21, 2006 7:08 pm, Colin Guthrie wrote:
> 
> I've used CVS a fair amount, no branching, as everybody always said
> what a bear it was to merge.
> 
> I keep hearing subversion is easier to branch/merge.

Absolutely! I never quite managed to "get" CVS's branching and merging.
It all worked etc. but it was very hard to visualise.

> Tomorrow, I've been tasked by the boss to find out HOW easy and how to
> do it for a big change that needs doing.
> 
> But I'd also like to hack away on the "little changes" in, err, the
> trunk, I guess...
> 
> So can I keep those both around?
> And would the branch live in a subdirectory or what?

In subversion this is very easy. The top level names "trunk", "branches"
and "tags" are just convensions used in subversion and it's generally a
good idea to use these are your root folders.

Just think about subversion as a big filesystem the base is / (or D:\ if
you're a windows person). In that base you have three folders trunk,
branches and tags. Inside the /trunk folder you can create a folder for
any given project.

If you want to branch, you just copy the /trunk/myproject/ folder to
e.g. /branches/myproject/bigchangeforboss/

You can then checkout the branch and work happily on implementing large
changes, commiting them as normal.

In a different location, you can also checkout /trunk/myproject/ and do
the little changes.

If you want those littel changes to also go into the branch, it's just a
simple matter of using the svn merge command to effectivly copy the
changes you made in trunk to your branch. This is just a matter of
saying "I want the changes made in trunk between revision x and revision
y to be applied to my local checkout of this branch". The changes are
merged into  you checkout (it's best to do merges when you have no
uncommited changes in your checkout). You will then have quite simply a
local repository with changes to the files. You then just have to commit
them with a relevent log message: e.g. svn commit -m "Merged revisions
x-y from trunk."

Hope that helps.

Col.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux