Skip to Content
Node与Express开发(第2版)
book

Node与Express开发(第2版)

by Ethan Brown
June 2021
Intermediate to advanced
290 pages
9h 21m
Chinese
Posts & Telecom Press
Content preview from Node与Express开发(第2版)
项目整顿
|
29
作,来试验一些新东西,而无须担心会影响项目的稳定性。如果试验成功,就把代码合
并进项目;如果不成功,丢弃即可。
多年前,我把版本控制系统切换成了分布式版本控制系统(
DVCS
)
,最后将选择范围缩
小到
Git
和
Mercurial
,并选择了
Git
。选择
Git
是因为它无处不在且设计灵活
。当然,
Git
和
Mercurial
都
是很优秀且免费的版本控制系统,值得推荐。本书中将使用
Git
,你要使用
Mercurial
(或干脆使用其他的)也可以。
如果不熟悉
Git
,推荐你阅读
Jon Loeliger
的精品大作
Version Control with Git
(
O
’
Reilly
出 版 )。
4.4
 在本书学习中如何使用
Git
首先确认是否安装了
Git
。键入
git --version
,如果没有输出版本号信息,则需要先安装
Git
。关于如何安装
Git
,请查看其官方文档。
本书中的代码示例有两种使用方式。一种是亲手录入每个示例的代码,然后再输入
Git
命
令进行版本管理。另一种是复制用于所有示例的版本库,然后检出每个示例的代码文件。
有人自己录入代码可以学得更好;有人则更愿意查看完整代码,做些修改后再运行,免得
全部重新录入。
4.4.1
 亲手录入
我们的项目已经有了十分粗糙的框架,即包含几个视图文件、一个布局文件、一个图标文
件、一个项目主文件和一个
package.json
文件
。接下来,创建一个
Git
版本库,并把所有
这些文件加进去。
首先进入项目目录,在这里初始化一个
Git
版本库:
git init
在把文件加入版本库之前 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

面向对象的思考过程(原书第5版)

面向对象的思考过程(原书第5版)

马特 魏斯费尔德
精通模块化JavaScript

精通模块化JavaScript

Nicolás Bevacqua

Publisher Resources

ISBN: 9787115565099