Search code examples
gitgit-fork

How to move forked repo back to the main repo?


I wrote a plugin, on git and it was forked by someone else and made better, with additional stuff, how can I bring the forked stuff to my repo?


Solution

  • Go to your original repository. Then add a new remote say, forked with the clone URL of forked repository. Then Pull the changes from forked repository into your origin repository. Now you can Push the changes to remote master or another branch.

    $ git remote add forked <forked-repo-url>
    
    $ git checkout master
    $ git pull forked master    # now your repo's master = forked repo's master
    
    $ git push origin master    # push/update remote master