gpt4 book ai didi

git - 如何将不活跃的 GitHub PR merge 到我自己的 fork 中?

转载 作者:太空狗 更新时间:2023-10-29 14:10:14 25 4
gpt4 key购买 nike

GitHub 上有一个未被官方存储库接受的公开 PR。我想将此 PR merge 到我的分支中。似乎同时删除了创建 PR 的 fork 存储库。我能够从 PR 中获取完整的更改数据作为补丁文件,但是我缺少一个信息以便我可以应用它:补丁应该应用到哪个提交?我尝试了存储库历史记录中的各个点,但总是有一些无法应用的“笨蛋”。

我说的PR是Flying Saucer PR #22 ,补丁文件可以通过appending .patch to the URL获取(感谢 Download Github pull request as unified diff 对此进行了描述)。

有没有一种方法可以获取提交哈希值或目标存储库历史记录中某个点的其他标识(针对该点进行 PR),或者是否有其他方法可以将此类不活跃和废弃的 PR merge 到我自己的复刻中?

最佳答案

经过更多搜索后,我找到了描述如何处理非事件 PR 的文档 - Modifying an inactive pull request locally :

  • Find the ID number of the inactive pull request. This is the sequence of digits right after the pull request's title.

  • Open Git Bash.

  • Fetch the reference to the pull request based on its ID number, creating a new branch in the process.

    git fetch origin pull/ID/head:BRANCHNAME

  • Switch to the new branch that's based on this pull request:

    [master] $ git checkout BRANCHNAME

    Switched to a new branch 'BRANCHNAME'

对我来说唯一的区别是不是从origin(这是我自己的分支)获取,而是从upstream(我已将其配置为指向主存储库)。

关于git - 如何将不活跃的 GitHub PR merge 到我自己的 fork 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53740351/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com