ZeroSuf3r ZeroSuf3r - 23 days ago 9
Git Question

github, update forked project

let's say repository from witch I clone (and only read-only for me) is:

git@github.com:secret_project/dev.git branch: dev


I forked project and url:

git@github.com:secret_user/Dde.git


(which I have full access: read+write)

But someone updated
git@github.com:secret_project/dev.git
from another forked version.

Let's say file changed on

git@github.com:secret_project/dev.git (test.txt)
content:
hi!


But my forked project have
test.txt
file with content:

hi


So how do I update forked project locally and in my repository ?

Which commands to use, and please make example with my showed repositories...

Answer

You should add to your local repo (which is a clone of your Dde.git fork) the remote address for the original repo 'upstream'.

git remote add upstream git://github.com/secret_project/dev.git # public read-only URL

That will allow you to pull 'upstream' into your own branch (merging and resolving any merge conflict in test.txt).
Then you will push your local branch to your Dde GitHub repo.

See GitHub help page: "Working with remotes" for more details.