Git

Git:在不同仓库之间 Cherry Pick

假设我们有两个仓库: 1https://github.com/Kong/kong 2https://github.com/Kong/kong-ee 想把 kong 仓库的的 master 分支上的 PR https://github.com/Kong/kong/pull/10629 对应的 commit cherry-pick 到 kong-ee 的 cherry-pick/10629 分支,应该怎样做? 首先,确保已经将 Kong/kong 和 Kong/kong-ee 两个仓库克隆到本地: 1git clone https://github.com/Kong/kong.git 2git clone https://github.com/Kong/kong-ee.git 进入 Kong/kong 仓库,切换到 master 分支: 1git switch master 更新到最新内容: 1git pull 找到 PR #10629 对应的 commit 哈希值。可以通过访问 PR 页面并查看 “Commits” 标签下的 commit 信息,或者使用以下命令查找 PR 对应的 commit(将 <pr_id> 替换为实际的 PR 编号): 1git log --pretty=oneline --graph --grep="#<pr_id>" 找到对应的 commit 哈希值,例如,将这个哈希值称为 <commit_hash>。 我这里是 b41d5bb05b35c5d52f9e87d8d96660719e85896a Read more...
1 of 1