Changes

Jump to: navigation, search

Hints for Using SVN to collaborate on school projects

273 bytes added, 01:29, 13 February 2012
branches
* '''branches''' is the common directory for all team members' workspaces.
* Each team member should create their own home directory or '''workspace''' (member-id1, member-id2,...) for their own development tasks within '''branches'''.
* Each team member should divide their workspace into several sub-directories (workspaces) during the development of the project. These workspaces(Task1, Task2, ...) are usually copies of the '''trunk''' to be worked on.*: ''These sub-directories(Task1, Task2,...) are called branches of trunk. When the word '''branch''' is used as a verb, it means copying the whole '''trunk''' into a sub-directory, either in '''branches''' or '''tags'''.(This method of development is called [http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.branchmerge.commonpatterns.feature Feature Branching]
==== tags ====
* '''trunk''' is the directory that holds the project in its current stage, '''complied and run-able'''
* '''trunk''' should never hold non-compiled code. Usually trunk is an exact copy (or better than) the latest version in '''tags'''.
* If the repository only contains one project is within the repository, then trunk has no project level sub-directory and is the root of the project. If Ifthe repository holds more than one project is within the repository, trunk is divided into several aubsub-directories - one for each project to be version-controlled.*: ''In this case , we divide '''tags''' should also be divided into exactly the same project sub-directories as present in '''trunk'''''
=== Basic Actions ===
A few important facts and terminology to help clarify the basic actions:
* One responsibility of a code repository is to keep track of all of the modifications done to a project by its team members.
*:In other words, in a project that is handled tracked by a code repository (version-controlled or in short versioned), you can track focus on any changes during the project's development life; such as, who modified/added/deleted what and when. You can undo work or rollback the work to any stage of the development and much more.
* SVN is a client/server repository;
*: The code Code is kept on a server and those members who have access can copy the whole or parts of the project to their local machines, work on the whole or parts and then apply their changes back to the server. Because of thisthe code is kept on a server, one member may be unaware of the changes made by another member, unless the other has applied the changes to the serverand the member has update their local copy.
* Merging the modifications of different members into the repository is another responsibility.
* A '''Version-controlled or versioned''' file is a file that is handled and tracked by a repository
To '''checkout''' is to copy the code from a repository server to a versioned directory on the client, so that you can start working on the code.
==== branch ====
To '''branch''' is to copy a one directory (like trunk) on the repository server into another directory on the repository server.: Note that '''branch'''ing the code copies it on '''the repository''' itself and not to on the local (client) machine. To work on the '''branch'''ed (copied) code, you must '''checkout''' the directory to which you copied the '''branch'''.
==== add ====
: You '''export''' when you want either to package the project, to make it ready for production, or to copy a piece of work from one repository to another repository.
==== import ====
To '''import''' is to copy a non-versioned work (directory) to a the repository server.: note Note that in this case although the imported code is on the server and , it is still NOT versioned on the client machine; to . To start working on an imported directory, you should need first to '''checkout''' the directory from the repository to the client machine.
== Starting a Project On SVN ==
#: We do this when someone else has started the project (that is, the professor, other team-members, etc.) and we want to copy the work into our own repository and continue that work.
=== Start the Project from zero ===
To start from zero, create the initial code of your project in '''trunk''', '''add''' the code, and then '''commit''' it. These are the detailed steps:
# '''checkout''' the project repository in a new directory on your local computer;#:# ''Create a new directory on your local computer, right click on the that directory, and then click on '''SVN Checkout'''
#:# In '''URL of the repository''' type your repository path (svn://zenit.senecac.on.ca/....)
#:# click Click on ok
# If the basic directories (trunk, tags, branches) don't exist, create them and add them by right clicking on them and selecting '''...SVN/add'''.
# In '''trunk''', create your project, compile it, and run it. (This could be as simple as a few empty files or a Hello world application).# Right click on the '''trunk''', select '''....SVN/add''', and then select all of the files you would like to be added add to the repository. #: Add only those files that you want to track for modification. "Only the source and project files need to be version-controlled". Binary and We don't usually add binary or executable files are usually not added to the repository. Add them only if you have a reason for doing so.
# Right click on '''trunk''' and select '''SVN Commit''' to commit your work to the repository server.
 
=== Start the project by continuing an existing work ===
To continue an existing work, you should have a '''non-versioned''' copy of the initial code for your project. You should copy Copy this code into the '''trunk''', '''add''' and '''commit'''it. These are the detailed steps:
# Copy the initial code into the '''trunk ''' of your repository#: If the code is available in another repository (say RepoSrc), '''export''' from RepoSrc into '''trunk ''' of your repository (say RepoDest)
#:# '''update''' RepoSrc to make sure that it is in sync with the server.
#:# Right click on the directory with the initial code in RepoSrc and select "'''...SVN/export"'''.#:# Select the '''trunk ''' of your own repository (RepoDest ) and click OK#:#: This will create a "non-version-controlledversioned" copy of the initial code in RepoDest/trunk# Do any modification needed to make the initial code ready for your own work# Right click on RepoDest/trunk and select '''Add'''. Then choose the files that you want to be would like "versioned"# Finally, '''Commit''' the '''trunk ''' to copy the those files to the SVN server.
== Preparing Your Own Workspace for Development ==

Navigation menu