Skip to Content
Git 團隊使用手冊
book

Git 團隊使用手冊

by Emma Jane Hogbin Westby
December 2016
Beginner to intermediate
352 pages
6h 10m
Chinese
GoTop Information, Inc.
Content preview from Git 團隊使用手冊
220
|
第十章
為什麼會想要送給自己拉取請求
如果自己是專案唯一的編輯者,也許就不需要為更動建立拉取請求,但拉
取請求是用
--no-ff
參數合併進
master
分支。也就是會在圖形化的歷史紀
錄中在
master
分支的時間線上顯示出凸起,要是不介意記錄在主分支上
的顯示是否明確,就可以省略建立拉取請求的步驟。本章稍後會介紹建立
與關閉拉取請求的詳細步驟。
將更動記錄到儲存庫後,就需要更新本機儲存庫反映出這些更動。
更新本機儲存庫
如果從網頁編輯器更新了分支,本機儲存庫上就不再是最新狀態(不要在本機分支重複
的編輯,Git 只會把相同時間建立的相同記錄視為是一樣的記錄),必須下載更動整合進
本機儲存庫,才能夠上傳其他的更動到 GitHub,步驟如下:
先切換到本機專案儲存庫所在的目錄,接著檢查使用者分支與遠端編輯的分支相同,例
如同樣是
master
分支:
$ git checkout master
接著將遠端的更動納入本機,由於更動會複製到相同的分支,又因為這些只是小更新而
不是新的功能,所以就使用
--rebase
納入更動而不是用
merge
,這種方式能讓圖形式歷
史紀錄較容易閱讀:
$ git pull --rebase=preserve
如此一來就更新了本機的分支,能夠開始新的作業。
使用 GitHub 上的公開專案
使用專案時可以選擇下載壓縮檔或是維持保有遠端儲存庫的連線,隨時下載更新,也保
留回饋個人更動給專案的可能性,本節要介紹使用 GitHub 的方式,但回饋回專案的相
關介紹得等到下一節再作介紹。
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

React: Up & Running, 2nd Edition

React: Up & Running, 2nd Edition

Stoyan Stefanov

Publisher Resources

ISBN: 9789864762453