Git - version control

1. Version Control

版本控制(Revision control)是一种在开发的过程中用于管理我们对文件、
目录或工程等内容的修改历史,方便查看更改历史记录,
备份以便恢复以前的版本的软件工程技术。

1.1 The role of version control

  • Realize cross-regional multi-person collaborative development
  • Track and record the history of one or more files
  • Organize and protect your source code and documentation
  • Statistical workload
  • Parallel development, improve development efficiency
  • Track and record the entire software development process
  • Reduce the burden on developers, save time, and reduce human error

Simply put, it is the technology used to manage multi-person collaborative development projects.

没有进行版本控制或者版本控制本身缺乏正确的流程管理,
在软件开发过程中将会引入很多问题,如软件代码的一致性、
软件内容的冗余、软件过程的事物性、软件开发过程中的并发性、
软件源代码的安全性,以及软件的整合等问题。

无论是工作还是学习,或者是自己做笔记,都经历过这样一个阶段!
我们就迫切需要一个版本控制工具!

Insert picture description here

Multiplayer development must use version control, otherwise the cost is very high!


1.2 Common version control tools

我们学习的东西,一定是当下最流行的!

主流的版本控制器有如下这些:
  • Git
  • SVN(Subversion)
  • CVS(Concurrent Versions System)
  • VSS(Micorosoft Visual SourceSafe)
  • TFS(Team Foundation Server)
  • Visual Studio Online

There are many version control products (Perforce, Rational ClearCase, RCS (GNU Revision Control System), Serena Dimention, SVK, BitKeeper, Monotone, Bazaar, Mercurial, SourceGear Vault), and now the most influential and widely used ones are Git and SVN


1.3 Classification of version control

1.3.1 Local version control

记录文件每次的更新,可以对每个版本做一个快照,
或是记录补丁文件,适合个人用,如RCS。

Insert picture description here


1.3.2 Centralized version control (representing SVN)

所有的版本数据都保存在服务器上,
协同开发者从服务器上同步更新或上传自己的修改。

Insert picture description here

所有的版本数据都存在服务器上,用户的本地只有自己以前所同步的版本,
如果不连网的话,用户就看不到历史版本,也无法切换版本验证问题,
或在不同分支工作。而且,所有数据都保存在单一的服务器上,
有很大的风险这个服务器会损坏,这样就会丢失所有的数据,
当然可以定期备份。代表产品:SVN、CVS、VSS

1.3.3 Distributed version control (on behalf of Git)

Everyone has all the code! Security risks!

所有版本信息仓库全部同步到本地的每个用户,
这样就可以在本地查看所有版本历史,可以离线在本地提交,
只需在连网时push到相应的服务器或其他用户那里。
由于每个用户那里保存的都是所有的版本数据,
只要有一个用户的设备没有问题就可以恢复所有的数据,
但这增加了本地存储空间的占用。

It will not be unable to work due to server damage or network problems!
Insert picture description here


1.3.4 The main difference between Git and SVN

SVN是集中式版本控制系统,版本库是集中放在中央服务器的,
而工作的时候,用的都是自己的电脑,所以首先要从中央服务器得到最新的版本,
然后工作,完成工作后,需要把自己做完的活推送到中央服务器。
集中式版本控制系统是必须联网才能工作,对网络带宽要求较高。



Git是分布式版本控制系统,没有中央服务器,
每个人的电脑就是一个完整的版本库,
工作的时候不需要联网了,因为版本都在自己电脑上。
协同的方法是这样的:比如说自己在电脑上改了文件A,
其他人也在电脑上改了文件A,这时,你们两之间只需把各自的修改推送给对方,
就可以互相看到对方的修改了。Git可以直接看到更新了哪些代码和文件!

Git is currently the most advanced distributed version control system in the world.


Guess you like

Origin blog.csdn.net/I_r_o_n_M_a_n/article/details/115360939