git - 如何从 github 挑选未合并的提交?
问题描述
我想挑选这个补丁:https ://github.com/gioele/vim-autoswap/pull/17/commits/b9f49977bac269be90807dc27c9931517c84ff15
我克隆了存储库并尝试了:
git cherry-pick b9f49977bac269be90807dc27c9931517c84ff15
得到:
fatal: bad object b9f49977bac269be90807dc27c9931517c84ff15
解决方案
好的,这是解决方案,从克隆的 github 存储库开始:
1)设置上游仓库(如果已经设置,请跳过此步骤)
git remote add upstream https://github.com/<gh_huser>/<gh_repo_name>.git
2)找到“拉请求”号。在原始帖子的情况下,它是“17”。在下一步中使用它。
3) 获取拉取请求
git fetch upstream pull/<pull_request_number>/head:<new_branch_name>
推荐阅读
- azure - 使用 azure.cognitiveservices.speech 的 WebSocket 升级失败,请求错误 (400)
- sql-server - 无法将 sql server 连接到 Visual Studio 代码
- zipfoundation - 使用 ZipFoundation 在内存中存档
- java - 如何配置 GitHub Actions 来 jlink 我的 Java 应用程序?
- tensorflow - 在 keras 或 tensorflow 的 adamOptimizer 中找不到 apply_gradients
- regex - 从特定单词到第一个结束字符匹配的正则表达式多行匹配
- laravel - 使用 laravel 和 vuejs 输入期间的动态数据存储
- google-kubernetes-engine - 如何配置 GKE 以仅保存控制平面日志?
- node.js - 使用 AWS Lambda (nodejs) 获取 twilio 使用数据
- reactjs - 是否可以将 html 元素放在材质 UI 网格的左侧?