Francesco Gadaleta

It is very common to fork a repo you are interested in and start reading code and learn how things are done. Then after a few days realizing that the forked repo is already behind upstream and need to resync. Here is a standard way of doing just this safely.

We will call the main project to fork https://github.com/author/cool-project.git and the forked repo will be at https://github.com/myself/cool-project.git

From the forked repo we need to add the remote upstream (the original repo we have forked from)

Then we need to fetch all branches with

Let’s move to master branch on the forked repo

and finally rebase. This means that all commits that are not yet in upstream (and usually they never are) will be applied on top of the other branch

Easy. Happy coding!

Originally published at https://codingossip.github.io on July 22, 2020.

The data governance framework you need for your organization

The adoption of artificial intelligence is rapidly spreading across many businesses. This disruptive technology is driving consistent improvements of the operational efficiencies and decision-making processes across a large variety of industries, and it is helping to better understand customer needs, improve service quality, predict and prevent risks, just to mention…

The adoption of artificial intelligence is rapidly spreading across many businesses. This technology is driving constant improvements in the decision-making processes and overall performance across a large variety of industries. It is also helping to better understand customer needs, improve service quality, predict and prevent risks.
The implementation of a proper…

Francesco Gadaleta

Managing Director @ amethix.com Chief Software Engineer & Host @datascienceathome.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store