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

An introduction to version control and Git

A version control system (sometimes called revision control) is a tool that lets you track the history and attribution of your project files over time (stored in a repository), and which helps the developers in the team to work together. Modern version control systems help them work simultaneously, in a non-blocking way, by giving each developer his or her own sandbox, preventing their work in progress from conflicting, and all the while providing a mechanism to merge changes and synchronize work.

Distributed version control systems such as Git give each developer his or her own copy of the project's history, a clone of a repository. This is what makes Git fast: nearly all operations are performed locally, and are flexible: you can set up repositories in many ways. Repositories meant for developing also provide a separate working area (or a worktree) with project files for each developer. The branching model used by Git enables cheap local branching and flexible branch publishing, allowing to use branches for context switching and for sandboxing different works in progress (making possible, among other things, a very flexible topic branch workflow).

The fact that the whole history is accessible allows for long-term undo, rewinding back to last working version, and so on. Tracking ownership of changes automatically makes it possible to find out who was responsible for any given area of code, and when each change was done. You can compare different revisions, go back to the revision a user is sending a bug report against, and even automatically find out which revision introduced a regression bug. The fact that Git is tracking changes to the tips of branches with reflog allows for easy undo and recovery.

A unique feature of Git is that it enables explicit access to the staging area for creating commits (new revisions of a project). This brings additional flexibility to managing your working area and deciding on the shape of a future commit.

All this flexibility and power comes at a cost. It is not easy to master using Git, even though it is quite easy to learn its basic use. This book will help you attain this expertise, but let's start with a reminder about basics with Git.

主站蜘蛛池模板: 合山市| 绥阳县| 青阳县| 廊坊市| 中山市| 潞城市| 莱芜市| 清新县| 临安市| 巩义市| 灯塔市| 屏东县| 河北省| 噶尔县| 遂川县| 县级市| 友谊县| 册亨县| 凌源市| 旬邑县| 信阳市| 板桥市| 工布江达县| 江川县| 宁安市| 抚远县| 象山县| 磐安县| 广灵县| 阿克陶县| 九江县| 昆山市| 理塘县| 望江县| 宝鸡市| 邳州市| 清水县| 黑水县| 墨玉县| 江口县| 昔阳县|