Putting your project under version control

From X-Cart 4 Classic
Revision as of 13:57, 25 February 2011 by Admin (talk | contribs) (What is Version control system ?)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Introduction to Version control

If you’ve used Microsoft Word or Excel, OpenOffice or any of the like, you may already be familiar with a process called version control or revision control. It’s the management of the changes made to a document by creating different or new versions each time it’s modified, and allows you to revert to any previous version if needed; some programs also allow you to merge versions. This is usually implemented on documents where changes are made often or if it’s being worked on by multiple people in a team.

When it comes to web development, team projects are very common. Developing a website can consist of a large amount of files that may need multiple modifications, making it a very important process to keep them organized. That’s specific software for these processes are available, which are called Version Control Systems (VCS for singular). A VCS is essentially a file database that keeps a collection of source files, archiving them with details of the history of all changes made, and can give you options such as file locking and merging.

There are different models of software available, which vary depending on how the information is shared. The deciding factors as to which VCS model to use depend on the type of project and amount of collaboration that will take place, as well as preference of a centralized system versus a peer-to-peer approach.

Why Version control ?

  • gives a project-wide undo button; nothing is final, and mistakes are easily rolled back
  • allows multiple developers to work on the same code base in a controlled manner
  • keeps a record of the changes made over time
  • works as a project-wide time machine, allowing you to dial in a date and see exactly what the project looked like on that date

What is Version control system ?

  • a place to store all the various revisions of the files you write while working on your project
  • it all goes to repository, a central place that holds the master copy of all versions of your files
  • should be safe, secure, reliable, gets backed up regularly

What to store ?

  • Source code
  • Test data
  • Database schema
  • Significant emails, minutes of meetings, info from the Web

Basic terminology

  • Working copy - local copy of all the things we need from the repository to work on our part of the project
  • Check out - extract to working copy. Ensures that you get up-to-date of the files you request and that these files are copied into a directory structure that mirrors that of the repository
  • Commit - save changes back to repository
  • Update - receive the latest set of files from repository

How to put your project under version control

[describe here]

Further reading