Question

Me and my friend are in different countries have been developing a LAMP web app for several weeks. All these times we have been sharing source code over ftp. In this way php files become messy. I have heard about CVS, and have been reading about it. But I still cannot figure out how it works exactly.

How does the CVS could help me in this matter ?

I would be much appreciated for someone who point me in the right direction.

Was it helpful?

Solution

Ok here comes a very simple explanation of VCS. After using it for a while you'll laugh at the explanation but for now I guess this should help you.

What are the problems of your current ftp file sharing?

  1. If 2 people upload the same file one of the files will get overwritten
  2. After uploading it you'll only see who changed the file (the last time) but not where it got changed
  3. You can't provide information about the changes (despite putting comments in the files itself)
  4. You can't go back in time, once uploaded old files are lost

With version control you can solve these problems:

  1. Files get either merged into one new file, or get overwritten but the old file will still be stored to roll back if needed
  2. You can see who made which changes when
  3. You can provide comments when you "upload" your files about what got changed (without storing these comments inside files)
  4. You can always go back in time and restore old "uploads"/changes
  5. You can also create small side projects by branching. This basically let's you split your project in smaller pieces and work on them separately.

So at the beginning of your work you usually get your local sources up-to-date by getting all the changes that got made. Then you do your work and afterwards you update the online version with your changes so that other developers can pull these changes and continue to work on them or integrate these changes into their current changes.

How to implement this sorcery? You could google for "how to implement git" or "how to implement svn" but I would recommend you to use an online service as a beginner. Here is a list of services: https://git.wiki.kernel.org/index.php/GitHosting

My personal preference for closed source projects with a low number of developers is https://bitbucket.org/. You get a small wiki page and bug tracking tool provided with some of the services. If you want to use bitbucket, here is the very easy to understand documentation: https://confluence.atlassian.com/display/BITBUCKET/Bitbucket+101

Important to know: Soon you'll learn that you don't upload files as I've written multiple times but rather change lines of code. You also don't upload them you "commit" them.

OTHER TIPS

While cvs could help, not many developers will recommend using it for new projects. It has largely been replaced with Subversion (svn), but even that is falling out of favour. Many projects these days use distributed version control with git or Mercurial (hg).

A good introduction to git can be found in the free online book Pro Git.

In any case, these things are all version control systems. They help to synchronize the code between developers, and also let you track

  • who changed code,
  • when it was changed,
  • why it was changed, and
  • how it was changed.

This is very important on projects with multiple developers, but there is value in using such a system even when working on your own.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top