[英]How to fork a project in Github again?
一個月前,我分叉了項目https://github.com/android/camera-samples ,分叉的項目在我的倉庫中列為 myname/camera。
今天發現https://github.com/android/camera-samples已經更新了,我又fork了這個項目。
在我看來,我的 repo 中的舊 myname/camera 將被更新,但實際上我的 myname/camera 沒有任何動作。
我是否必須先在我的倉庫中刪除 myname/camera,然后 fork https://github.com/android/camera-samples以獲得最新版本?
您需要sync
您的分叉。 最好的辦法是熟悉遙控器的概念
通過命令行查看所有remotes
:
git remote -v
git remote -v
origin https://github.com/HelloCW/camera-samples (fetch)
origin https://github.com/HelloCW/camera-samples (push)
git remote -v
origin https://github.com/HelloCW/camera-samples (fetch)
origin https://github.com/HelloCW/camera-samples (push)
upstream https://github.com/android/camera-samples (fetch)
upstream https://github.com/android/camera-samples (push)
您需要add
遠程並從上游存儲庫中pull
並將更新推送到您的 fork。
upstream --> local clone --> your fork
按着這些次序:
git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
git pull upstream master
無需刪除分叉的回購並再次分叉。
您是否注意到在您的分叉存儲庫中顯示fetch upstream
的彈出窗口?
單擊該按鈕,然后查看下拉菜單以fetch and merge
單擊該按鈕, updated-forked-repo
變為可用,而不會刪除original forked repo
。
查看圖像,它可能會幫助您找到選項。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.