Friday, July 5, 2013

Never lose your changes

One problem most of us have faced while developing software projects or even simple programs is breaking the entire program while trying to fix a program with some errors. So instead of fixing the few errors that we had initially we end up breaking the entire program itself.

It gets worse if you don't remember what changes you made to the file. This would generally mean that you would have to start from scratch again. When creating big projects this could mean disaster. People realized that this could be a huge problem and came up with something known as VCS. VCS stands for version control system. Though there are many vcs available like subversion, in this article we will primarily be focusing on Git.

Git is a version control system quite different from others. While other vcs systems remember the differences or modifications you make to a file, Git records different versions of your files as snapshots.
And if there are no modifications made to the file, it stores the snapshot as a reference(point) to the older version.

There are three states in Git: Repository, Staging area, Working directory.

The way it works is: You take a file from the working directory and push it to the staging area and make modifications. The staging area means that the files have been modified but not yet committed. You need to commit the files to let Git save the changes made to the file. At any time in the future if you feel that the you need to go back to the previous versions you can simply rollback the commits to go back to the version you deem is stable for your use.

Git is also a distributed vcs. This means that many users can collaborate on projects and work on the same files without the fear of over-writing each others work as the Git framework lets you have a snapshot of all the versions of the files.

To know more about Git, you can read from this free online book : Git Basics

The best way to work with git is using github.

Also many hiring managers from the silicon valley have said that a good github account gives them a lot of insight into a student, more than his mark sheets ever can.

No comments:

Post a Comment