user664859 user664859 - 1 year ago 92
Git Question

how to clone a git project into my project and still be aligned and contribute with the original project?

I am using this popular git project in my own bitbucket project.
The problem is that I'm sometimes missing some features in the original git project, and I would like to develop and contribute my own features.

I don't want to wait until the guys there will approve my code as I need to be responsive to my own clients.

So I would like to send them a commit to approve and keep working on my forked project that is linked to my own project.

What is the best way implementing this? Is there a real reason to keep two projects (my own and the forked one) or should I merge them both to my own project?

Please advice:)

Answer Source

A fork is really made for this.

Keep Up To Date with the Original Project:

  1. Create two remotes:

    • the github origin
    • your own origin (bitbucket)
  2. Fetch/Pull from both

  3. Rebase onto the github origin to incorporate all of their changes without creating unnecessary merge commits


Submit Pull Requests

It would be easier if your own code would live on Github because then you could use Githubs interface to create pull requests. The other party would have a nice interface for viewing the differences and it could be reference from Github's issue tracker.

Otherwise you would have to provide them with a patch (generated by git).

You would really only need a github project for the fork that contains the pull requests you want to publish and submit to the original project. All other custom features could be maintained on your Bitbucket project. In this case you would have 3 origins but synching them works just like with 2 origins (see above).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download