12

Is it possible to make pull requests between two different Github repositories? For example, if I have a branch called new-feature in Repository A, can I create a pull request and merge the changes into the master branch in Repository B?

Merging across repos is possible in git, but I can't find anything suggesting that Github supports it.

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
Katrina
  • 409
  • 5
  • 16

2 Answers2

7

The following would merge the changes of ProjectA with the ProjectB

# go to  projectB:
git remote add projectA path/to/projectA/NewFeature
git fetch projectA
git merge projectA/master 

Now Push these changes to your github ProjectB repository.

git push origin master
SloppyJoe
  • 393
  • 4
  • 7
4

If the repos are in different organizations on GitHub you can fork one and create pull requests cross forks from the GitHub interface.

But if you want to create pull requests between repos from the same organization on GitHub, you can edit the remotes on the original repo (Repository A in your example) and then "send" branches cross GitHub repositories and create the pull requests using GitHub interface.

Check my answer on git fork repo to same organization for more details.

Also, please note that this is only possible if Repository A and Repository B share at least part of commit history, otherwise you will just get a message like:

repositoryA/new-feature and repositoryB/master are entirely different commit histories.

When you try to create the PR.

leomilrib
  • 409
  • 5
  • 11