Blog

SVN: Moving from traditional FTP to advance file editing


My new job introduced me to an ever intimidating system or whatever it is called, Subversion (SVN). What is SVN According to wikipedia: "Apache Subversion (often abbreviated SVN, after the command name svn) is a software versioning and a revision control system distributed under a free license. Developers use Subversion to maintain current and historical versions of files such as source code, web pages, and documentation. Its goal is to be a mostly-compatible successor to the widely used Concurrent Versions System" In simple terms, it manages file editing on every upload(commit), download(update) and every new major version(branch) and reverts(merge). Advantages of SVN  
  1. Faster upload/download - It records each commit so you can revert anytime. In each commit and update, only the changes are being saved, so it is faster than FTP that uploads the whole file which causes some problems specially when your connection is bad. This also applies to download(update).
  2. Less reason to backup - when working on with a team, it's easier to retrieve old files due to unexpected overwrite or upload error or accidental deletes. Each upload(commit) is recorded and it's easy to open, edit and re-uploaded(revert, edit and commited)
  3. Team mates can edit one file at the same time - lesser need to ask permission from your team mates to edit something, cause you can all edit at once.
    1. example:
      1. teammate A edits the file,
      2. then teammate B edits the same file.
      3. Teammate A is done with the changes, and uploads(commits) it.
      4. On the other hand, teammate B is unaware and tried to upload(commit) his copy
      5. teammate B recieves an error, that his copy is outdated
      6. teammate B download(updates) the file from the server
      7. If teammate B's changes and teammate A's changes are on different lines of the code, they will be combined(merge)
      8. Teammate B can now upload(commit) the file
  4. Team mates can work on separate instance of the project (branches) - team mates can work on a copy based on the stable version(or any branch), after those separate copies becomes stable, they will be merged with the stable version(called trunk), using the merge action of svn or the svn client.
  5. You can separate each stable versions neatly(tags) - of course this can be done on your own way, but svn clients warns you when overwriting or committing a file on the stable version or in svn term, a "tag".

Directory Structure

There is three main directories that is generally accepted on SVN. The "trunk", is the stable version; The "branches" contains the non stable versions of trunk, the "tags" contains the past stable versions of "trunk".
Naming convention under branches and tags depends on your preference.
The directory structure will appear like this:
  • branches/
    • 1.1.new-design.123
      • includes/
      • assets/
        • css/
          • common.css
          • common-new.css
      • index.php
    • 1.2.new-page.126
      • includes/
      • assets/
        • css/
          • common.css
      • about.php
      • index.php
  • tags/
    • 1.0.basic-version.123
      • includes/
      • assets/
      • index.php
  • trunk/
    • includes/
    • assets/
    • index.php

Comments (0)


Add a Comment





Allowed tags: <b><i><br>Add a new comment:


A Few Accomplishments

Integer eu ante ornare amet commetus vestibulum blandit integer in curae ac faucibus integer non. Adipiscing cubilia elementum integer. Integer eu ante ornare amet commetus.

Possibly broke spacetime

Integer eu ante ornare amet commetus vestibulum blandit integer in curae ac faucibus integer adipiscing ornare amet.

Terraformed a small moon

Integer eu ante ornare amet commetus vestibulum blandit integer in curae ac faucibus integer adipiscing ornare amet.

Snapped dark matter in the wild

Integer eu ante ornare amet commetus vestibulum blandit integer in curae ac faucibus integer adipiscing ornare amet.

Contact Me

Integer eu ante ornare amet commetus vestibulum blandit integer in curae ac faucibus integer non. Adipiscing cubilia elementum integer. Integer eu ante ornare amet commetus.