Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The theory (and terminology) behind Source Control

I've tried using source control for a couple projects but still don't really understand it. For these projects, we've used TortoiseSVN and have only had one line of revisions. (No trunk, branch, or any of that.) If there is a recommended way to set up source control systems, what are they? What are the reasons and benifits for setting it up that way? What is the underlying differences between the workings of a centralized and distributed source control system?

like image 736
Cristián Romo Avatar asked Aug 17 '08 01:08

Cristián Romo


People also ask

How do you explain source control?

Source control (or version control) is the practice of tracking and managing changes to code. Source control management (SCM) systems provide a running history of code development and help to resolve conflicts when merging contributions from multiple sources.

What is an example of source control?

Source control refers to the use of masks to cover a person's mouth and nose and to help reduce the spread of large respiratory droplets to others when the person talks, sneezes, or coughs.

What are the three main benefits of source control?

Some benefits of source control are: It allows multiple developers to work on the same codebase. Developers can commit and merge code without conflicts. Developers can edit shared code without unknowingly overwriting each other's work.

What are the basic concepts of version control?

Version control enables multiple people to simultaneously work on a single project. Each person edits his or her own copy of the files and chooses when to share those changes with the rest of the team. Thus, temporary or partial edits by one person do not interfere with another person's work.


1 Answers

Think of source control as a giant "Undo" button for your source code. Every time you check in, you're adding a point to which you can roll back. Even if you don't use branching/merging, this feature alone can be very valuable.

Additionally, by having one 'authoritative' version of the source control, it becomes much easier to back up.

Centralized vs. distributed... the difference is really that in distributed, there isn't necessarily one 'authoritative' version of the source control, although in practice people usually still do have the master tree.

The big advantage to distributed source control is two-fold:

  1. When you use distributed source control, you have the whole source tree on your local machine. You can commit, create branches, and work pretty much as though you were all alone, and then when you're ready to push up your changes, you can promote them from your machine to the master copy. If you're working "offline" a lot, this can be a huge benefit.

  2. You don't have to ask anybody's permission to become a distributor of the source control. If person A is running the project, but person B and C want to make changes, and share those changes with each other, it becomes much easier with distributed source control.

like image 119
Brad Wilson Avatar answered Jan 04 '23 20:01

Brad Wilson