Version Control
- In Turkish
- Sürüm Kontrolü
In short
Version control is a system that records every change to a set of files, so you can see who changed what, return to earlier versions and work in parallel.
What is version control?
Version control, also called source control, keeps the history of a project. Each saved change records what changed, who changed it, when and why, so you can compare versions, find when a bug appeared and undo a mistake without losing anyone else's work.
Modern version control systems are distributed: every developer has the full history on their own machine, works on a branch, and later merges their changes with everyone else's. Git is by far the most widely used; Subversion, Mercurial and Perforce are older or more specialized alternatives, and services such as GitHub and GitLab host the shared repositories.
Version control is the base of team software work. Code review, continuous integration and releases all build on it: every change can be traced to a commit, every release to a tag, and every experiment can live on a branch until it is ready.
Key takeaways
- Version control records each change to a project's files with its author, date and reason.
- You can compare, restore and combine versions instead of copying folders.
- Distributed systems such as Git give every developer the full history.
- Branches let people work in parallel and merge their changes later.
Example
git init # start tracking a project
git add index.html # choose the changes to save
git commit -m "Add home page" # record them, with a message
git log --oneline # see the history
git switch -c new-menu # try something on a separate branchReaders ask
What is the difference between version control and Git?
Version control is the general idea and practice; Git is one version control system, the most popular one. GitHub and GitLab are services that host Git repositories and add tools such as pull requests on top.
Is version control only for code?
No. It works for any files that change over time, such as documentation, configuration, design files or a book manuscript, although it is most useful for text files, whose changes it can show line by line.
See also
- GitVersion Control, p. 10Git is a free, open-source distributed version control system that tracks changes to files over time, so developers can collaborate and undo mistakes.
- CommitVersion Control, p. 5A commit is a saved snapshot of a project's files in Git, recorded with a unique ID, an author, a timestamp, and a message describing what changed.
- BranchVersion Control, p. 2A branch in Git is an independent line of development that lets you work on a feature or fix in isolation, without affecting the main code until you merge it.
- MergeVersion Control, p. 29A merge in Git combines the changes from one branch into another, joining separate lines of development back together into a single, shared history.
- RepositoryVersion Control, p. 34A repository is the storage location for a project, holding all of its files plus the complete history of every change recorded by a version control system.
- GitHubVersion Control, p. 25GitHub is a platform for hosting Git repositories and working on code together, with pull requests, code review, issues and the largest open-source community.
- Pull RequestVersion Control, p. 32A pull request is a proposal to merge changes from one branch into another, giving teammates a place to review, discuss, and test the code before it is merged.
- Code ReviewVersion Control, p. 4A code review is the practice of having other developers check code changes before they are merged, to catch bugs, improve quality, and share knowledge.
Spotted a mistake or something missing on this page?Suggest an edit