# About Version Control

### What

A version control system is a tool that keeps track of changes for us.

It effectively creating different versions of our files.

It allows us to decide which changes will be made to the next version (each record of these changes is called a [commit](https://swcarpentry.github.io/git-novice/reference.html#commit).

It keeps useful metadata about them.

The complete history of commits for a particular project and their metadata make up a [repository](https://swcarpentry.github.io/git-novice/reference.html#repository).

Repositories can be kept in sync across different computers, facilitating collaboration among different people.

Automated version control systems are nothing new. Tools like RCS, CVS, or Subversion have been around since the early 1980s and are used by many large companies. However, many of these are now considered legacy systems (i.e., outdated) due to various limitations in their capabilities. More modern systems, such as Git and Mercurial, are distributed, meaning that they do not need a centralized server to host the repository. These modern systems also include powerful merging tools that make it possible for multiple authors to work on the same files concurrently.

### Why

We make changes to files, and there are different versions of documents to keep. it seems unnecessary to have multiple nearly-identical versions of the same document.

Version control systems start with a base version of the document and then record changes we make each step of the way. We can think of it as a recording of our progress: We can rewind to start at the base document and play back each change we made, eventually arriving at our more recent version.

<figure><img src="https://498238201-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWuHhstIreJ3jFvE4gQ3y%2Fuploads%2FRoxnALpqIQwJcf6wRiAV%2Fimage.png?alt=media&#x26;token=994ce5b9-395d-4c41-a8bd-5ebd6c48f9b0" alt=""><figcaption></figcaption></figure>

Once you think of changes as separate from the document itself, you can then think about “playing back” different sets of changes on the base document, ultimately resulting in different versions of that document. For example, two users can make independent sets of changes on the same document.

<figure><img src="https://498238201-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWuHhstIreJ3jFvE4gQ3y%2Fuploads%2F83flqME1uD4617L59l7H%2Fimage.png?alt=media&#x26;token=7a218f61-d739-4159-9089-9b8116cc2450" alt=""><figcaption></figcaption></figure>

Unless multiple users make changes to the same section of the document - a conflict - you can incorporate two sets of changes into the same base document.

<figure><img src="https://498238201-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWuHhstIreJ3jFvE4gQ3y%2Fuploads%2FdK6Km8kRJX6RRov6VSf7%2Fimage.png?alt=media&#x26;token=14c652b5-6621-4b9a-bbf5-b688722bfc5a" alt=""><figcaption></figcaption></figure>

* An Example: Paper Writing

Imagine you drafted an excellent paragraph for a paper you are writing, but later ruined it. How would you retrieve the excellent version of your conclusion? Is it even possible?

Imagine you have 5 co-authors. How would you manage the changes and comments they make to your paper? If you use LibreOffice Writer or Microsoft Word, what happens if you accept changes made using the Track Changes option? Do you have a history of those changes?

[Solution](http://rous.mit.edu/index.php/Solution)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://igb.mit.edu/mini-courses/version-control-with-git/about-version-control.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
