Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating a GitHub fork repo in the web interface

I would like to synchronize a forked GitHub repo with the original using the GitHub web interface.

Most of the solutions on the web talk about doing this on the command-line.

I found the following two threads with the solution I needed -

  • update github fork from web only (in other words WITHOUT GIT!)
  • https://webapps.stackexchange.com/questions/28998/

I am able to successfully create a pull request for the forked repo and merge it. However this transaction is recorded as an additional commit in the forked repo.

Now if I compare the original one with the fork this additional commit shows up -

Original repo - https://github.com/linode/docs
Forked repo - https://github.com/jesinwp/docs

like image 875
A.Jesin Avatar asked Aug 04 '14 14:08

A.Jesin


People also ask

How do I update my forked repository GitHub?

On GitHub, navigate to the main page of the forked repository that you want to sync with the upstream repository. Select the Sync fork dropdown. Review the details about the commits from the upstream repository, then click Update branch.

How do I update fork repository?

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.

Does forked repo automatically update?

2. The new API. Next method I have for you to synchronize your forked repo with the upstream one requires a little more setup, but then it will allow you to keep the repos in sync automatically.


2 Answers

The addition of a merge commit is how pull requests work. It's part of the normal process of merging branches in Git and keeps the history clear as far as when a branch gets merged into another.

As far as keeping your forked repo in sync with the upstream repo, AFAIK Github doesn't support that. It basically requires you to fetch both remotes locally and merge the upstream's branch (master, in this case) into the same branch in your forked version.

I'm sure any Git reference can describe this further in detail much better than I can.

like image 97
hlfcoding Avatar answered Sep 21 '22 06:09

hlfcoding


As of September 26, 2016, it is now possible to merge a pull request using GitHub's web interface without creating a merge commit. Simply use the "Rebase and merge" option when merging.

'Rebase and merge' option

like image 24
Stevoisiak Avatar answered Sep 18 '22 06:09

Stevoisiak