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版)
30
|
第
4
章
.gitignore
文件中的条目也会应用到子目录。因此,如果你把
*~
加入到项目
根目录的
.gitignore
文件里,那么所有子目录中的备份文件都会被忽略。
现在可以把所有文件都加入版本库了。对此,
Git
有多种做法。我通常更喜欢用一次能提
交全部变更的
git add -A
。但如果你是
Git
新手,我的建议是,如果只想提交一两个文件,
就一个一个地加入(如
git add meadowlark.js
),否则就使用
git add -A
一次性提交全部
变更(包括你删除的文件,如果有的话)。不过,既然想提交所有的工作,那么就使用:
git add -A
Git
的新用户常常搞不清
git add
命令,此命令加入的是对文件所做的
变更
,
不是文件。因此,如果修改了
meadowlark.js
,
然后键入
git add meadowlark.
js
,那么实际是把你对这个文件所做的变更加入版本控制。
Git
有一个“暂存区”,当运行
git add
时,变更就记录到那里。因此,刚加入的变更实际
上还没有提交,只是准备好提交了。使用
git commit
提交变更:
git commit -m "Initial commit."
-m "Initial commit."
选项允许写一条关于此次提交的说明。如果没有提交说明,
Git
则不
允许提交变更。这是合理的。提交说明应当言之有理,能够简洁而完整地描述你做了什么
变更。
4.4.2
 使用官方版本库
要获取本书的官方版本库,请登录
GitHub
官网,搜索
EthanRBrown/web-development-with- ...
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