Subversion on a Gentoo server, Windows client

Reasons to use Subversion:

  • Safety
  • Share your projects between all collaborators
  • Compare two revisions
  • Retrieve when was a modification committed
  • Conflicts management
  • Locks

1) Create the repository
svnadmin create /var/svn/Blabla
2) Permissions
chown -R apache:svnusers /var/svn/Blabla
chmod -R g-w /var/svn/Blabla
chmod -R g+rw /var/svn/Blabla/db
chmod -R g+rw /var/svn/Blabla/locks

3) Create your SVN user
vim /var/svn/Blabla/conf/authz : Right before the aliases section, insert monica=rw
vim /var/svn/Blabla/conf/passwd : monica=mypassword

4) Import your project
svn import /home/monica/Blabla file:///var/svn/Blabla/trunk -m ‘Initial commit’

5) Test its content
svn ls file:///var/svn/Blabla/trunk

6) Checkout the project on your computer
  • Install Tortoise SVN (or any other SVN client)
  • On your computer, create a Blabla folder (or Blabla_test, or MySuperProject)
  • Right clic on this folder : SVN Checkout…
    • URL of repository : svn://myserver/Blabla/trunk
    • Checkout directory: D:\Blabla
    • Checkout depth: Fully recursive
    • Revision : HEAD revision

7) Update
Always update your project before starting to work on it, in order to always use the most recent version:
  • Right clic on the project folder 
  • SVN Update

8) Modify a file
  • Right clic on the project folder
  • SVN Commit… : This action makes any modification definitive by sending the modified file to the repository
  • To cancel your modification please see next section

9) Revert (cancel a modification)
  • Right clic on the file or its parent-folder
  • Tortoise SVN > Revert…

10) Conflicts
A conflict might be raised when:
  • The same file is modified by two people
  • Your project is not up to date
Conflicts may be handled automatically by configuring your SVN server, but merging manually the conflicted files allows you to avoid losing information.

11) Lock
To avoid conflicts, one may use locks, but some Subversion users say that it is against SVN spirit (sharing files between people).
Do not forget to release the lock when you stop working on the file. To force the lock release, you have to delete it on the repo.


12) Rename
  • Right clic
  • Tortoise SVN > Rename…
Renaming loses log history. To keep it, rename the file or folder on your repository.

13) Add / delete

You cannot just add or delete tour file/folder from your project copy, you have to send this modification to the repository so that everyone will see it.

  • Add :
    • Add your new file in the project
    • Right clic on it : Tortoise SVN > Add…
    • Right clic on it : SVN Commit…
  • Delete :
    • Right clic on the file to be deleted : Tortoise SVN > Delete
    • Go to the parent folder
    • Right clic on it : SVN Commit…

14) Refresh
  • Right clic on your project folder : Tortoise SDVN > Clean up
  • F5 to refresh the Windows Explorer

15) Delete the project
  • Deleting the project on your computer will not affect the project from your SVN server.
  • To delete it from your server (meaning you will lose all revisions and log history) : rm -r /var/svn/Blabla

 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: