Do you know how to sync your fork to the original repository via the browser?

Sometime you can meet the situation that you fork a repository and you contribute to it, then it could happen that your fork and the upstream are not in sync anymore. In my previous blog post I explained how face that kind of situation by adding remote upstream.
Today iâm going to talks about sync your fork to the original repository via the browser. When you create a fork of a repository, you only have the versions of the files that are in the repository at that time. So if there are any changes in the original repository you may find that your fork is out of sync.
This can lead to problems when you try to create a pull request. While GitHub has instructions for merging an upstream repository into your fork they require you to have git installed on your local machine.đ Therefore i search that if there is any other simply way to done with the browser rather using installing git locally.
Fortunately I found that on Stack Overflow answer, there is another simple way which can update your fork in the browser by following the easy steps.
- Open your fork of the repository.
- Click the compare button.

3. This will open a page titled Comparing Changes and if you look carefully youâll have jumped to the upstream version of the repository. If you were to do a regular pull request then this makes sense as youâd be bringing your changes into the upstream version. But in this case we want to flip the direction and pull changes from the original version to our fork.
4. Change the base fork to your repository

5. Youâre now back to your fork but youâve also asked to compare two identical repositories so GitHub thinks you care about branches not forks. Click on compare across forks to get back your base fork option.
6. Change the head fork to the upstream (original) repository
Note at this point that if you were in control of everything at GitHub you would probably just have put a little button in between the base for and head fork that would have flipped them for you rather than doing all these clicks. You might even had added in a separate button to check for upstream changes! But they do know that this is a bit of a silly hack and theyâre working hard on a bunch of other cool stuff so weâll let them off this one.
7. Youâll see one of two options:
â âThere isnât anything to compareâ This means youâre up to date and you donât have to do anything. Phew.
â A list of commits. These are the changes that have happened in the repository since you forked your version. Go to step 8.
8. Create a pull request.
Note that this pull request is to you! So you can confirm that itâs ok and merge it when necessary. And if there are any merge conflicts then itâs up to you to figure out whatâs gone wrong and sort them out.
And now youâre ready to continue working on your forkđ
Well done!
