When you fork someone’s repository on GitHub, you’ll want to update your fork with any changes made to the original. There are various ways to do this. In this quick tip, Bruno describes how to update your fork via the GitHub website. Another option is to update your fork via the command line.
I often find myself having to update my fork of someone else’s repo to include the changes made to the original since the fork. In fact, we use this approach often in SitePoint’s Peer Review System as well.
Purely by accident, I’ve recently discovered a way to quickly and easily sync a fork with the original repo through the GitHub web UI, so no need to go commando (use the command line).
Note that the approach below does a merge commit, not a proper rebase. If you understand what this means, this is something that will matter to you. In a nutshell, the history looks different than when syncing via the command line as per Github docs. No real effect, but just a heads up!
Here’s a step by step guide, as applied to my out-of-date fork of Gatekeeper:
Step 1: New PR
Go to your own fork’s UI, and click the “New Pull Request” button:
This will take you to a screen not too different from this one:
Step 2: Base Switch
If the option to try “switching the base” is there, click that.
If the option isn’t there, switch the bases manually by using the provided dropdowns, and set them up so that your fork is on the left, and the original is on the right, like so:
Step 3: Send and Merge
Click the green “Create Pull Request” button. In the input fields that appear, give it a title like “Syncing from original”. Optionally, add a description.
Again, click the “Create Pull Request” button to actually send the PR. The result should be a typical PR screen:
Feel free to merge it with the “Merge Pull Request” button (and “Confirm Merge” afterwards), and you’re done!
That’s it – your fork is now in-sync with the changes made to the original, and you can start working on it without fear of conflicts.
10 Top WordPress Ecommerce Themes for 2021
By Monique Danao,
With WordPress themes, you can build a great ecommerce site without being a designer or coder. Here are ten top WordPress ecommerce themes.
A Beginner’s Guide to Keras: Digit Recognition in 30 Minutes
By Shaumik Daityari,
Want to create an artificial neural network? Learn step by step how to create a model for recognizing handwritten digits.
A Comparison of Ruby Version Managers for macOS
By Daniel Kehoe,
If you're a serious Ruby developer, you'll need an up-to-date version, possibly several. We cover the best Ruby version managers for macOS.
Bruno is a blockchain developer and technical educator at the Web3 Foundation, the foundation that's building the next generation of the free people's internet. He runs two newsletters you should subscribe to if you're interested in Web3.0: Dot Leap covers ecosystem and tech development of Web3, and NFT Review covers the evolution of the non-fungible token (digital collectibles) ecosystem inside this emerging new web. His current passion project is RMRK.app, the most advanced NFT system in the world, which allows NFTs to own other NFTs, NFTs to react to emotion, NFTs to be governed democratically, and NFTs to be multiple things at once.