讓你fork下來的項目與源項目保持同步

原文在此, 建議閱讀, 我把關鍵步驟抽出來了, 方便概覽

(也就是add remote upstream, fetch upstream, rebase, 再push)

Step 1: Forking a repo

git clone https://github.com/nitin-test/blog-example-fork.git
git remote add upstream https://github.com/nitstorm/blog-example.git
git remote
git remote show origin
git remote show upstream

Step 2: Making changes and submitting Pull Requests

git checkout -b word-addition
git commit -am "Adds the word memory"
git push origin word-addition
# 網頁端發起merge到master

Step 3: Keeping the forked repo synced with the main repo

# 確保你是在master分支
git checkout master
git fetch upstream
git rebase upstream/master
git push origin master
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容