I forked the project https://github.com/android/camera-samples a month ago, the forked project is listed as myname/camera in my repo.
Today I find that https://github.com/android/camera-samples has been updated, I fork the project again.
In my mind, the old myname/camera in my repo will be update, but in fact no action im my myname/camera.
Do I must delete myname/camera in my repo first, then fork https://github.com/android/camera-samples for the latest edition?
You need to sync
your fork. The best thing would be to familiarize yourself with the concept of remotes
See all of your remotes
via command line:
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)
You need to add
a remote and pull
from the upstream repository and push the updates to your fork.
upstream --> local clone --> your fork
Follow these steps:
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
Github page snapshot showing how to fetch updated code
No need to delete the forked repo and fork again.
Did you notice the pop-up stating fetch upstream
on your forked-repo?
Click that button, then see the dropdown to fetch and merge
Click that and the updated-forked-repo
becomes available without deleting the original forked repo
.
Have a look at the image and it might help you find the option.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.