如何创建一个完整仓库的pull request以供审查?
git checkout -b review
git push origin review
git checkout --orphan empty
git rm -rf .
git commit --allow-empty -m "root commit"
git push origin empty
如需了解如何创建空分支,请查看Github上创建空分支的方法。
现在,如果您尝试从master分支向empty分支发起拉取请求,将会收到以下错误消息:
无法比较。empty分支和review分支包含完全不同的提交历史记录。
为了解决这个问题,您需要将empty分支合并到review分支,以便它们共享提交历史记录。
git checkout review
git merge empty --allow-unrelated-histories
git push origin review