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

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.

主站蜘蛛池模板: 嫩江县| 阳曲县| 红桥区| 融水| 射洪县| 梁山县| 聊城市| 横山县| 邻水| 宝丰县| 赣榆县| 寿阳县| 灵石县| 从江县| 宿松县| 沙雅县| 岳阳县| 东宁县| 兴义市| 威信县| 浦城县| 浮山县| 乌拉特中旗| 嘉祥县| 修文县| 丽水市| 阿坝县| 手机| 凤台县| 青浦区| 安福县| 连州市| 牡丹江市| 咸丰县| 贡觉县| 共和县| 杨浦区| 文昌市| 宽甸| 乌兰县| 甘洛县|