benzarr410
benzarr410

Reputation: 43

Can you open a pull request to add code from a repo to yours?

Basically, I have a user who forked a repository of mine. I like the improvements they've made to my code, so I'd like to add it to my repo. Is there anyway I can open a pull request or use some method to add their code to my repo?

Upvotes: 4

Views: 44

Answers (1)

instantepiphany
instantepiphany

Reputation: 179

The most appropriate thing to do would be to contact them and ask if they could open a pull request to merge their changes into your original repository.

While you could also clone their repo, add your original as a remote, merge the changes locally and then push to your own repo, you would need to check their license, and they might not know that you pulled their work into yours. If you want to try this, do the following:

  1. Clone the fork containing the code you want to merge.
  2. make sure the fork is in sync.
  3. Add your original repository as a remote for the fork you just cloned.
  4. Push the new work to your original repository using the remote you just created, ideally you should push it to a feature/topic branch so there is a nice history of commits for future reference.
  5. Thank the author of the code, and send them a link to the new branch the code is on on your repository, so they can see their work being used by others.

If someone liked changes I made in a fork of their repository, I would appreciate hearing that direct from them, and would happily open a PR if they asked. That's the easy route.

Upvotes: 4

Related Questions