读书笔记:《Version Control With Git》
2015-01-04 20:37
465 查看
地一章 简介
首先提到了VCS(Version Control System)的基本功能:
Although the authors and users of each tool might debate esoterics, each system address the same issues: develop and maintain a repository of content, provider access to historical editions of each datium, and record all changes in a log.
其次提到了Linus对于BitKeeper的替代品的期望。其实这些期望也可以看作Git的特点:
Facilitate distributed development(支持分布式开发)
也就是人们不需要随时的和中心仓库同步。人们可以独立、并行的开发,甚至在一些离线的本地环境中也不会遇到问题。
Scale to handle thousands of developers(可以支持上千名开发人员)
Perform quickly and efficiently(高效)
相较于集中化的版本控制系统而言,Git每次只保存增量,无疑更有优势。
Maintain integrity and trust(保持完整和可信)
Enforce accountability(可靠性)
Immutability(不变性)
Atomic transactions(原子事物)
Support and encourage branched development(支持并鼓励分支开发)
Complete repositories(完整的代码库)
A clean internal design(干净的内部设计)
Be free, as in freedom(免费)
那么Git时如何满足这些需求的呢?哪些需求时我们的日常开发中也会遇到的呢?有哪些最佳实践呢?遗憾的是,这一章中并没有进一步进行阐述。
从Git-Scm的文档中我们可能找到一些提示:
Git直接记录快照而不是增量
近乎所有的操作都是本地执行。这一点使得人们可以在离线状态下进行开发。准确的说,不只是开发,大部分的版本控制操作都可以在离线状态下完成!
时刻保持完整性。这一特性是机遇SHA1加密算法对于每个对象提供数字指纹来完成的。
多数操作仅添加操作。
接下来,我会带着上面的问题略过第二章(安装),直接进入第三章(开始)进行学习。
=======================================
附录一个常用的协作开发流程(参与已有项目开发):
在Github上fork一个branch
Git clone到本地
添加upstream: git remote add upstream (地址),可以通过git remote -v来查看是否添加成功。这主要是为了能够pull到其他人的change。
创建新的分支:git branch branch_name。并切换到对应branch:git checkout branch_name。通过git branch可以查看当前的分支。
开发
git add . 添加所有的change。可以通过git status来查看相关状态
git commit -m "message"。
git push origin branch_name。
在github上发一个pull request
code review并重复开发、添加、commit、push的步骤直到被merge。
首先提到了VCS(Version Control System)的基本功能:
Although the authors and users of each tool might debate esoterics, each system address the same issues: develop and maintain a repository of content, provider access to historical editions of each datium, and record all changes in a log.
其次提到了Linus对于BitKeeper的替代品的期望。其实这些期望也可以看作Git的特点:
Facilitate distributed development(支持分布式开发)
也就是人们不需要随时的和中心仓库同步。人们可以独立、并行的开发,甚至在一些离线的本地环境中也不会遇到问题。
Scale to handle thousands of developers(可以支持上千名开发人员)
Perform quickly and efficiently(高效)
相较于集中化的版本控制系统而言,Git每次只保存增量,无疑更有优势。
Maintain integrity and trust(保持完整和可信)
Enforce accountability(可靠性)
Immutability(不变性)
Atomic transactions(原子事物)
Support and encourage branched development(支持并鼓励分支开发)
Complete repositories(完整的代码库)
A clean internal design(干净的内部设计)
Be free, as in freedom(免费)
那么Git时如何满足这些需求的呢?哪些需求时我们的日常开发中也会遇到的呢?有哪些最佳实践呢?遗憾的是,这一章中并没有进一步进行阐述。
从Git-Scm的文档中我们可能找到一些提示:
Git直接记录快照而不是增量
近乎所有的操作都是本地执行。这一点使得人们可以在离线状态下进行开发。准确的说,不只是开发,大部分的版本控制操作都可以在离线状态下完成!
时刻保持完整性。这一特性是机遇SHA1加密算法对于每个对象提供数字指纹来完成的。
多数操作仅添加操作。
接下来,我会带着上面的问题略过第二章(安装),直接进入第三章(开始)进行学习。
=======================================
附录一个常用的协作开发流程(参与已有项目开发):
在Github上fork一个branch
Git clone到本地
添加upstream: git remote add upstream (地址),可以通过git remote -v来查看是否添加成功。这主要是为了能够pull到其他人的change。
创建新的分支:git branch branch_name。并切换到对应branch:git checkout branch_name。通过git branch可以查看当前的分支。
开发
git add . 添加所有的change。可以通过git status来查看相关状态
git commit -m "message"。
git push origin branch_name。
在github上发一个pull request
code review并重复开发、添加、commit、push的步骤直到被merge。
相关文章推荐
- Version Control with Repo and Git
- 优达学城《Version control with Git》笔记
- 推荐《Version Control with Subversion》
- version control system:git/hg/subversion/cvs/clearcase/vss。software configruation management。代码集成CI:Cruisecontrol/hudson/buildbot
- Using Beyond Compare with Version Control Systems under OSX
- version control system:git/hg/subversion/cvs/clearcase/vss。software configruation management。代码集成CI:Cruisecontrol/hudson/buildbot
- Why Use Git Instead of a Legacy Version Control System
- Advanced SQL Server Monitor with Performance Graph, Analysis and Version Control
- How To Use Git Source Control with Xcode in iOS 6
- Using Version Control with Unity
- Git: Version Control for Everyone ebook
- 【引】Version Control System - SVN - Developing and Deploying with Branches
- IDEA version Control 下没有git菜单
- Using Beyond Compare with Version Control Systems
- Pragmatic Version Control with CVS
- Git : Distributed version control system
- software_base-version_control-git-normal
- Learning Source Control with Git and SourceTree.pdf
- Pragmatic Version Control Using Git学习笔记
- Using External Version Control Systems with Unity【使用第三方版本控制工具】