GitHub:当分支没有更多与 master 共同的历史记录时如何重新打开拉取请求
GitHub: how to re-open a pull request when the branch has no more history in common with master
我正在玩 GitHub 操作并在 PR 上测试 commit linter(从名为 meh
到 master
的虚拟分支),我设法做到了让它工作,除了我需要更改我以前的提交消息(当时已经推送)以匹配提交 linter 正则表达式(使用常规提交)。
所以我从一开始就对每个提交进行 git rebase -i --root
和 reword
编辑,然后我将提交推送到我的分支 meh
,除了当我这样做的时候PR 自动关闭,我无法 reopen or create a new one (from the same branch meh
to master
) 因为 GitHub:
The meh branch has no history in common with master.
如何重新打开我的 PR?
就像@alaniwi said, this could be solved with what is described here:
Try the following command:
git pull origin master --allow-unrelated-histories
This should solve your problem.
话虽这么说,如果您必须 git push --force ...
,您也可以在某些时候弄乱提交的 SHA1,所以是的,重新打开 PR 是可行的,但是您的 CI 可能会尖叫一点。
我正在玩 GitHub 操作并在 PR 上测试 commit linter(从名为 meh
到 master
的虚拟分支),我设法做到了让它工作,除了我需要更改我以前的提交消息(当时已经推送)以匹配提交 linter 正则表达式(使用常规提交)。
所以我从一开始就对每个提交进行 git rebase -i --root
和 reword
编辑,然后我将提交推送到我的分支 meh
,除了当我这样做的时候PR 自动关闭,我无法 reopen or create a new one (from the same branch meh
to master
) 因为 GitHub:
The meh branch has no history in common with master.
如何重新打开我的 PR?
就像@alaniwi said, this could be solved with what is described here:
Try the following command:
git pull origin master --allow-unrelated-histories
This should solve your problem.
话虽这么说,如果您必须 git push --force ...
,您也可以在某些时候弄乱提交的 SHA1,所以是的,重新打开 PR 是可行的,但是您的 CI 可能会尖叫一点。