How to sync fork with original github project?

I created the fork of some GitHub project. Then I created a new branch and made a patch inside this branch. I sent a download request to the author, and he applied my patch and added some commits later. How can I sync my fork on GitHub with the original project? Can I remove my fork on GitHub and create a new fork for each of my patches every time?

+5
source share
1 answer

You do not need refork again. Just add the remote (say, upstream ) and fetch upstream to update the cloned repository.

 $ git remote add upstream <original-repo-url> $ git fetch upstream # update local with upstream $ git diff HEAD..upstream/master # see diffs between local and upstream/master (if there is no diff then both are in sync) $ git pull upstream master # pull upstream master into local branch $ git push origin HEAD # push to your forked repo remote branch 
+8
source

Source: https://habr.com/ru/post/1262512/


All Articles