TimJ
TimJ

Reputation: 496

How to create a pull request on the entirety of a new Github repository

How do you create a pull request of an entire repository for review?

Upvotes: 5

Views: 2391

Answers (1)

TimJ
TimJ

Reputation: 496

First, create a new branch called review. This just to be safe so that you don't accidentally clear master and your whole repository.

git checkout -b review
git push origin review

Create an orphan branch with no history.

git checkout --orphan empty
git rm -rf .
git commit --allow-empty -m "root commit"
git push origin empty

See Create empty branch on GitHub for more information on creating an empty branch.

Now, if you go to Github and try to open a pull request from master into empty, you'll get the following error message:

There isn’t anything to compare. empty and review are entirely different commit histories.

To fix this, you need to merge empty into review so that they share history.

git checkout review
git merge empty --allow-unrelated-histories
git push origin review

Now, you can create a pull request of review into empty in Github.

Upvotes: 9

Related Questions