Subversion and Eclipse basics

Set up Subversion with Eclipse and the plugin Subclipse

Create a SVN repository and the project folder, then check out the project with Eclipse work in your code an commit changes.

 

=============================
SUBVERSION AND ECLIPSE BASICS
=============================



1. Create the SVN REPOSITORY
----------------------------

In the repository server

# svnadmin create /usr/local/subversion/my_project



2. Create a file structure for the project
------------------------------------------

The working copy is in the same the repository server: so create a directory to host the files related to
the project OUTSIDE the repository folder:


# mkdir -p /home/allprojects/my_project
# cd /home/allprojects/my_project


# mkdir trunk
# mkdir branches
# mkdir tags

Add you first new proyect files INSIDE the folder my_project/trunk/



3. Import project files into the repository
-------------------------------------------

# cd /home/allprojects

# svn import my_project file:///usr/local/subversion/my_project -m "Initial import"



4. Change files owner
---------------------

--- In the repository
# chown -R www-data:www-data /usr/local/subversion/my_project

--- In project folder
# chown -R www-data:www-data  /home/allprojects/my_project

Check details with ls -lisa



5.Eclipse: Create a new location
--------------------------------

Right click on your project name, choose Import to display the import manager.
Choose Other > Checkout Projects from SVN, then click Next.

Check Create location and write the location url:

http://127.0.0.1/svn/my_project/trunk



6. Eclipse: Checking Out a Project from the Repository
------------------------------------------------------

Window > Open SVN perspective  Click the + next to your repository.
To check out a project right click on any folder/project
and select Check Out as Project.
If the project that you are checking out already exists in the workspace,
the old project will be destroyed and the project from
the SVN repository will be created in its place.
Otherwise a new project will be created in the workspace.
Switch back to the Java perspective to work in your code.



7. Commit
---------

To commit changes to files in your project, right click on the project
and select Team > Commit.



Commit problems command
-----------------------

(Resume commit action)
/usr/local/subversion/my_project/hooks/post-commit