Skip to Content
Node.js物聯網裝置開發
book

Node.js物聯網裝置開發

by Patrick Mulder, Kelsey Breseman
August 2017
Intermediate to advanced
272 pages
5h 32m
Chinese
GoTop Information, Inc.
Content preview from Node.js物聯網裝置開發
使用 Git 部署專案
|
89
使用 Git 部署專案
想要讓一塊單板電腦正常開機、並且以 JavaScript 程式讓 LED 閃爍,需要多花一點設定
時間、多一點耐心。因為有著完整的檔案系統,以及連接網路的硬體,需要藉由幾支好
用的腳本程式與工具,從旁輔助我們的開發工作。
版本控管工具,可幫助我們同步裝置與開發主機(如你的筆電)之間的專案檔案狀態,
也可進行複製作業。基本上,它要負責的事情就跟第 4 章的 Tessel 2 指令相同(
t2 run
t2 push
)。
若您初次聽聞 Git 的大名,請到官網
https://git-scm.com/
瀏覽、四處看看,
所需基本指令有
git init
git add
git commit
。一旦加入程式檔並提交
到程式貯藏庫(repository),就能以指令
git log
追蹤專案的歷史演變。
Git 特別吸引人的優點在於,它能夠處理位於網路遠端的貯藏庫,你從
GitHub Heroku 所學到的知識與概念,都能運用在嵌入式裝置上。
首先,在遠端裝置上初始化一個赤裸(bare)的 Git 貯藏庫。例如若是 Edison 的話,指
令大致如下:
$ ssh root@eddie.local
# mkdir -p git/led13.git && cd $_
# git init --bare
Initialized empty Git repository in /home/root/projects/buttons/git/led13.git/
所謂赤裸的貯藏庫,看起來比較像是資料庫、而不是專案的拷貝品 ...
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

金融人工智能:用Python实现AI量化交易

金融人工智能:用Python实现AI量化交易

Yves Hilpisch
快学熟用D3

快学熟用D3

Philipp K. Janert

Publisher Resources

ISBN: 9789864764594