About Version Control

(this post if part of the material I cover in my devops course)

version control (from the git-scm site)

What happened to me when I did a small, single-person home project

(this story has not really happen..but it could)
Here's what used to happen to me in the past, when I was trying to backup my code.

  • I was working on my files in place A (that was some directory on my computer)
  • To backup, I would zip all files, and move the zip file onto location B
    (which was another directory)
  • 3 days have passed.
    I wanted to backup my files again, but...I've made some experimental changes in those 3 days, and I was not ready to delete that first backup (B) YET.
  • So, I have moved the new zip file to a new location C.
    (Wait, better call that zip-file by a name that would include the zip-creation date.)
  • The next day I sent my code (zip file from B) to Dave, for testing.
    (Not the current code(A), since I KNEW that there was a nasty bug there, and C was not ready yet.)
  • Went back to work on A.
  • Dave was calling with some changes (he has found the bug..).
    I wanted to work on that.
    You see?
    This is why I eventually created directory B1.
    • I had to start from B (to be the same as what I had sent to Dave)
    • I had fixed that nasty bug
    • then saved it again, but not on B (maybe my new fix was not OK)
    • so B1
  • Now I was too afraid to add another programmer to my project.
    • I'd have to explain everything
    • I'd have to consult with them before each change, send email messages with zip files
  • So I kelp working alone :)
  • It didn't solve my source problems, though.

About version control

There's a lot of information about version control out there on the Internet, so I will try to summarize for you what it will do for you:

  • It will let you store versions of any text you write (code, description files data etc.) so that you can go back and find text you have deleted or changed.
  • It will be easy to keep different version of anything:
    • that version I sent to Dave
    • the version where I fixed the code I sent to dave
    • the version with all the new changes (but where dave bug still exist)
    • etc...
  • It will be much easier to synchronize among developers working on the same source file.
  • If you use a version control from recent years, you'll have some remote server that will keep copies of you code, so you also get some kind of backup for source