Search For A Solution!

Total Pageviews

Thursday, April 16, 2020

HOW TO: UPDATE A FORK REPOSITORY via WEB INTERFACE


STEPS:

  1. Go to the Forked Repo (yours) and Click button - "New pull request".
  2. On the page that opens, there is a a blue link "switching base" in the message shown as per example below...
  3. Click the link. It will automatically take you to your original repo.
  4. Click Create Pull Request button and write some commit message.
    Now it will lead to your forked repo automatically...
  5. Click Merge pull request

Confirm merge
to finish.


OR as per another tech lobzik

  • Open your fork on GitHub.
  • Click on Pull Requests
  • Click on New Pull Request. By default, GitHub will compare the original with your fork, and there shouldn't be anything to compare if you didn't make any changes. 
  • Click switching the base if you see that link. Otherwise, manually set the base fork drop down to your fork, and the head fork to the upstream. Now GitHub will compare your fork with the original, and you should see all the latest changes. 
enter image description here

  • Create pull request and assign a predictable name to your pull request (e.g., Update from original).
  • Scroll down to Merge pull request, but don't click anything yet. 
    • Now you have three options, but each will lead to a less-than-clean commit history. 
    • The default will create an ugly merge commit
    • If you click the dropdown and choose "Squash and merge", all intervening commits will be squashed into one. This is most often something you don't want. 
    • If you click Rebase and merge, all commits will be made "with" you, the original PRs will link to your PR, and GitHub will display This branch is X commits ahead, Y commits behind <original fork>.

 Enjoy!

No comments:

Post a Comment