Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I merge the commits made to a fork back to the original project?

Despite programming for a few years now, I'm still trying to wrap my head around some concepts when it comes to Git. To illustrate what I'm asking, let's set the stage with a hypothetical situation:

  • I create a open-source clone of Flappy Bird for whatever reason and make the code available on GitHub under a MIT license
  • Someone finds my chicken-scratch code and decides to fork the project (note: not fork for pull request) then proceeds to make well-meaning improvements

With the Git system, is it possible to merge commits from forks upstream?

like image 864
Jonathin Avatar asked Jan 25 '23 18:01

Jonathin


1 Answers

To add to hellyale's comment, if you see a fork whose (for instance) master branch has some changes you want to test / get into your own original repository ("upstream" compared to that fork), you don't have to wait for a pull request.

You can, in a local clone of your own repository, do:

git remote add fork https://url/fork
git fetch fork
git merge fork/master
# test, and if good
git push
like image 176
VonC Avatar answered Jan 28 '23 10:01

VonC