是否可以从 github 中挑选所有待处理的 PR?
假设我有来自 4 个不同分支存储库的 4 个 PR 等待审查。我需要将它们全部应用到最新的源代码中。
PR#65 Do something
PR#61 Notify this
PR#55 Fix that
PR#42 Show there
我知道我可以git remote add
所有存储库并一一挑选。但是,我相信会有更简单/更快捷的方法来挑选所有待处理的 pull 请求,我还不知道 ;)
提前致谢
最佳答案
简而言之:
将 pr/* 添加到 .git/config
详细说明:
假设存储库名为 test_repo
$ git remote -v
test_repo http://github/testA.git (fetch)
test_repo http://github/testA.git (push)
1。打开 git 配置
vim .git/config
2。在 [remote "test_repo"]
下添加以下行
fetch = +refs/pull/*/head:refs/remotes/test_repo/pr/*
看起来像
[remote "test_repo"]
url = http://github/testA.git
fetch = +refs/heads/*:refs/remotes/test_repo/*
fetch = +refs/pull/*/head:refs/remotes/test_repo/pr/* <-- this line was added
3。 “git fetch”也将获取 PR
$ git fetch test_repo
* [new ref] refs/pull/16/head -> test_repo/pr/16
* [new ref] refs/pull/17/head -> test_repo/pr/17
* [new ref] refs/pull/18/head -> test_repo/pr/18
* [new ref] refs/pull/19/head -> test_repo/pr/19
4。现在你可以挑选/checkout 到 PR #xx
git cherry-pick test_repo/pr/xx
关于git - 可以从 github 中挑选所有 PR( pull 请求)吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42968431/