官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 饶阳县| 上饶市| 伊宁市| 博野县| 隆德县| 诸城市| 农安县| 汪清县| 巴塘县| 齐河县| 垣曲县| 沙湾县| 曲周县| 武山县| 宝鸡市| 乌鲁木齐县| 桂阳县| 泗水县| 津南区| 西青区| 潞西市| 内江市| 北海市| 离岛区| 苍南县| 阿合奇县| 九江县| 皮山县| 南乐县| 文安县| 会东县| 柏乡县| 汝城县| 廉江市| 兴和县| 军事| 海晏县| 安国市| 原平市| 宝清县| 泗阳县|