版本控制Version control

版本控制是管理許多不同版本之檔案的系統,而且在軟體開發中,通常是由許多開發人員提供。Version control is a system for managing files over many different versions, and - in software development - is generally contributed to by many developers. 任何版本控制系統的主要目的 (VCS) 都是尋找方案,讓所有使用者同時處理程式碼基底。The principal purpose of any version control system (VCS) is to find a solution that enables all users to work on the codebase at the same time.

任何版本控制系統的核心都是「存放庫」,可作為所有不同檔案的中央資料存放區,並與檔案伺服器類似。At the core of any version control system is a repository, which acts as the central data store for all the different files - similar to a file server. 不過,與檔案伺服器不同,存放庫包含專案的整個歷程記錄以及所有已進行的修訂。However, unlike a file server, the repository contains the entire history of the project and all revisions that have been made.

如果存放庫是中央資料存放區,則每位使用者邏輯上都會有資料的本機存放區,可讓他們進行處理。If the repository is the central data store, it is logical for each user to have a local store of the data, allowing them to work on it. 這稱為「工作複本」。This is called a working copy. 在 Visual Studio for Mac 中,您的工作複本將會顯示為電腦上的任何其他本機目錄,讓您可以讀取和寫入任何檔案。In Visual Studio for Mac your working copy will appear just as any other local directory on your machine, allowing you to read from and write to any of the files. 不過,因為 Visual Studio for Mac 具有版本控制系統整合,所以您可以在不需要離開 IDE 的情況下使用 Subversion 和 Git。However, because Visual Studio for Mac has Version control system integration, you can use Subversion and Git without leaving the IDE.

Subversion 是集中式的版本控制系統,這表示會有包含所有檔案和修訂的單一伺服器,而使用者可以從中簽出任何檔案的任何版本。Subversion is a centralized version control system, which means that there is a single server that contains all files and revisions from which users can check out any version of any file. 從遠端 Subversion 存放庫簽出檔案時,使用者會收到存放庫在該時間點的快照集。When files are checked out from a remote Subversion repository, the user gets a snapshot of the repository at that point in time.

Git 是一種分散式版本控制系統,可讓小組同時處理相同的文件。Git is a distributed version control system that allows teams to work on the same documents simultaneously. Git 可能也會有包含所有檔案的單一伺服器,差異在於每當從這個中央來源簽出存放庫時,系統就會將整個存放庫本機複製至您的電腦。With Git there might be a single server that contains all the files, but the entire repository is cloned locally to your machine whenever a repository is checked out from this central source.

基本概念Basic Concepts

Visual Studio for Mac 同時支援 Git 和 Subversion 版本控制系統。Visual Studio for Mac provides support for both Git and Subversion version control systems. 下面的文章會探討如何透過 Visual Studio for Mac 設定 Git 和 Subversion 存放庫,以及檢閱、認可和推送變更這類簡單功能。The following articles explore setting up Git and Subversion repositories through Visual Studio for Mac, as well as simple functionality such as reviewing, committing, and pushing changes.