I created the fork of some GitHub project. Then I created new branch and did a patch inside of that branch. I sent the pull request to author and he applied my patch and added some commits later. How can I synchronize my fork on GitHub with original project now? Am I to delete my fork on GitHub and create new fork for each my patch each time?
To sync your forked repo with the parent or central repo on GitHub you: Create a pull request on GitHub.com to update your fork of the repository from the original repository, and. Run the git pull command in the terminal to update your local clone.
You can fork any repo by clicking the fork button in the upper right hand corner of a repo page. Click on the Fork button to fork any repo on github.com.
You don't need to refork
again. Just add a remote (say, upstream
) and fetch upstream
to update your 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's master into local branch
$ git push origin HEAD # push to your forked repo's remote branch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With