In software development, a repository is a central file storage location. It is used by version control systems to store multiple versions of files. While a repository can be configured on a local machine for a single user, it is often stored on a server, which can be accessed by multiple users.
A repository contains three primary elements — a trunk, branches, and tags. The trunk contains the current version of a software project. This may include multiple source code files, as well as other resources used by the program. Branches are used to store new versions of the program. A developer may create a new branch whenever he makes substantial revisions to the program. If a branch contains unwanted changes, it can be discontinued. Otherwise, it can be merged back into the trunk as the latest version. Tags are used to save versions of a project, but are not meant for active development. For example, a developer may create a "release tag" each time a new version of the software is released.
A repository provides a structured way for programmers to store development files. This can be helpful for any type of software development, but it is especially important for large development projects. By committing changes to a repository, developers can quickly revert to a previous version of a program if a recent update causes bugs or other problems. Many version control systems even support side-by-side comparisons of different versions of files saved in the repository, which can be helpful for debugging source code. Additionally, when a repository is stored on a server, users can "check out" files for editing, which prevents files from being edited by more than one user at a time.