-
在GitHub網站上點擊repository的
Fork
按鈕 -
在電腦上Clone你建立的fork
git clone https://github.com/user/repo.git
- <或>
- 在你的fork點擊
Clone in Desktop
按鈕
-
設定remote upstream
git remote add upstream https://github.com/otheruser/repo.git
git fetch upstream
-
抓取遠端倉庫的分支及提交
git fetch upstream
-
合併遠端的變更到你的本地分支
git checkout master
git merge upstream/master
-
解决衝突
- 直接編輯
- <或>
git mergetool
-
重新提交
git commit
-
抓取遠端倉庫的分支及提交
git fetch upstream
-
建立並切換到上游分支的本地版
git checkout -b newbranch upstream/newbranch
-
當你準備好後將他推送到origin
git push -u origin newbranch