What is Source Control

Process and Methodology Frequently asked questions

What is Source Control?

As a developer, you must have heard about Source Code Control (SCC). When you work alone you do not have to share sources with other developers, and using of SCC is usually unnecessary. However, when working in team you have to share sources.

You may say - "It is simple: put all the sources into a network drive and several developers will be able to work with them?" Yes, it is a possible decision. However, what happens, if two developers modify the same file? You are right; changes of one of them will be lost. Source control systems help to avoid this problem.

The idea is to store recently added sources on a server and not to modify them directly. Each developer gets his own copy instead. If a developer wants to modify a file, he performs checkout (informs others that he is going to modify that file); when the modification is done, he uploads (or checks in) the file to the server. The server resolves conflicts (when two users modify the same file) automatically on the line level, i.e. if one developer modifies the top lines and another - the bottom ones, the file will be automatically merged. If they modify the same lines then the developer being the last to upload the changes has to resolve the conflict manually, but it happens very seldom.

This is the main function of a source control system. Moreover, source control systems provide some additional useful functions such as - comparison of versions (visual), rollback, notifications, tags, branches, history, and locks and so on. Due to these functions, using of source control is helpful for a single developer in his work, since it makes backup of different versions of a source code unnecessary.


Comments