[英]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.