Revision control
No matter whether you are working alone or in a large development team, properly keeping track of the development progress is extremely important. Revision control tools allows developers to roll back failed experiments at any time with the press of a button, and visiting its history gives a clear view on how the project is evolving at any time.
A revision control system, also known as version control system, or VCS, encourages cooperation by making merge operations easier. The most updated official version is referred to as a trunk or master branch, depending on the VCS in use.
One of the most modern and widely used open source VCSs is Git. Originally created as the VCS for the Linux kernel, Git offers a range of features, but most importantly provides a flexible mechanism to allow switching among different versions and feature branches quickly and reliably, and facilitates the integration of conflicting modifications in the code. Git terminology is used in this book when describing specific activities related to the VCS.
A commit is a VCS action that results in a new version of the repository. The repository keeps track of the sequence of commits and the changes introduced on each version, in a hierarchical structure. A linear sequence of commits is a branch. The latest version in a branch is called HEAD.
Git refers to the main development branch as master. The master branch is the main focus of the development. Bug fixes and minor changes are committed directly on the master. Feature branches are created for self-contained tasks in progressing and ongoing experiments, which will be eventually merged into the master. When not abused, feature branches are a perfect fit when working in a smaller sub-team on a task, and can simplify the code review process, reducing it to validating completed tasks as single merge requests.
A merge operation consists of joining together two versions from two different branches that may have perged and present conflict in the code through the development. Some merges are trivial and automatically resolved by the VCS, while others may require manual fixing.
Using meaningful and verbose commit messages improves the readability of the history of the repository, and can help to track regressions later on. Tags can be used to track intermediate versions that are released and distributed.