步驟:
-
git remote -v
首先是否建立了主repo的遠程源
如:
image.png
類似這樣,只有自己的 fetch
、push
,就是沒有。
git remote add main https://github.com/quark-ui/quark-ui.git
那就需要添加主repo的源
main: 一個本地別名(upstream)(自己定義)
后邊的倉庫地址,就是fork 別人的倉庫地址-
git remote -v
查看是否添加上
如:
image.png
已經添加上 git fetch main
git merge main/master
兩步合并變化
如果要刪除 upstream,執行git remote rm [本地別名]
如:git remote rm main