# Versioning Models

### The Problem of File Sharing

All version control systems have to solve the same fundamental problem: how will the system allow users to share information, but prevent them from accidentally stepping on each other's feet?

![](https://3408508746-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lis5JLcnSD2vdYdyQ3U%2F-Lk0rhJZCS6US5fZVzby%2F-Lk0sb_xPN_-w-fJzLrP%2Fimage.png?alt=media\&token=0221828e-a8c4-4785-b1aa-56871dda1fbc)

### The Lock-Modify-Unlock Solution

Many version control systems use a *lock-modify-unlock* model to address the problem of many authors clobbering each other's work. In this model, the repository allows only one person to change a file at a time.

![](https://3408508746-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lis5JLcnSD2vdYdyQ3U%2F-Lk0rhJZCS6US5fZVzby%2F-Lk0skpHb1m2TZLS78S6%2Fimage.png?alt=media\&token=654517c2-99f5-4909-a702-f27786254622)

### The Copy-Modify-Merge Solution

Subversion, CVS, and many other version control systems use a *copy-modify-merge* model as an alternative to locking. In this model, each user's client contacts the project repository and creates a personal *working copy*—a local reflection of the repository's files and directories. Users then work simultaneously and independently, modifying their private copies. Finally, the private copies are merged together into a new, final version. The version control system often assists with the merging, but ultimately, a human being is responsible for making it happen correctly.

![](https://3408508746-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lis5JLcnSD2vdYdyQ3U%2F-Lk0rhJZCS6US5fZVzby%2F-Lk0srrzJG30CrCIduF6%2Fimage.png?alt=media\&token=7e1314c4-e540-47b8-8314-3c6ed3686af9)

Then

![](https://3408508746-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lis5JLcnSD2vdYdyQ3U%2F-Lk0rhJZCS6US5fZVzby%2F-Lk0suy9pV1FmWcbOFPf%2Fimage.png?alt=media\&token=c4c95e57-81c4-41c9-89be-a4faff7db308)
