Reputation: 2255
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?
Upvotes: 2
Views: 1623
Reputation: 11
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.
Upvotes: 1
Reputation: 2813
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 [email protected]: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
Source: https://gist.github.com/CristinaSolana/1885435
Upvotes: 3