Git refs merge vs head in pull request
Git refs merge vs head in pull request
refs/pull// head 指的是 PR 的负责人,但是 refs/pull//merge 呢,我没有找到任何 git 提交,在提交历史记录中显示为 /merge 的一部分。这个 /merge 对 PR 到底意味着什么,当 PR 有多个 cmmits 时,当 PR 打开时,当 PR 关闭时等
$ git ls-remote
From git@<repo url>
01c8cd97857c21cfc5d413bd64e3c0e8cc8fd03d HEAD
37b88346a9edb426f676d080be502a1d4349c499 refs/heads/PR1
6fda26f078c00adf518ec620e94f54daa85bb894 refs/heads/PR1-1
bd88e471db4127f066b3b2f1d699b8296ca62f6d refs/heads/PR5
25b5eec47ca186a778c93439cd81e8a4125b5d6f refs/heads/PR6
58a82cf11218991f8f544a14ef6c57d3963690ee refs/heads/PR7
a5831973e1a4561527551a8bc8a9d5f9436f004b refs/heads/Pr2
01c8cd97857c21cfc5d413bd64e3c0e8cc8fd03d refs/heads/develop
442c0bc7f8b3872660d48cbd42690be677314b94 refs/heads/master
37b88346a9edb426f676d080be502a1d4349c499 refs/pull/1/head
2db24e8a6a53ce006694c4c5db1886df44620372 refs/pull/1/merge
a5831973e1a4561527551a8bc8a9d5f9436f004b refs/pull/2/head
4ea1814dda65e2ca8572fbbc5da9cc8141391ab8 refs/pull/2/merge
6fda26f078c00adf518ec620e94f54daa85bb894 refs/pull/3/head
b6cde57523fc73ce08dd7e588eeb606c3f047136 refs/pull/3/merge
442c0bc7f8b3872660d48cbd42690be677314b94 refs/pull/4/head
58a82cf11218991f8f544a14ef6c57d3963690ee refs/pull/5/head
e4a82d455b8b8e81b70dfbf4f6d79a1fb5158cbb refs/pull/5/merge
bd88e471db4127f066b3b2f1d699b8296ca62f6d refs/pull/6/head
e8825e286aa9c36c04046c5d4ac85c9d7a4ebf5c refs/pull/6/merge
25b5eec47ca186a778c93439cd81e8a4125b5d6f refs/pull/7/head
ed262d8c4766b037207f3113b634c777b3a0af37 refs/pull/7/merge
例如。
25b5eec47ca186a778c93439cd81e8a4125b5d6f refs/pull/7/头
ed262d8c4766b037207f3113b634c777b3a0af37 refs/pull/7/merge/
ed262d8c4766b037207f3113b634c777b3a0af37 的意义是什么 refs/pull/7/merge/
并且在任何地方都找不到此提交 ID ed262d8c4766b037207f3113b634c777b3a0af37
refs/pull/<number>/merge
是由 GitHub 创建的参考,用于跟踪合并拉取请求后会发生什么。它引用 refs/pull/<number>/head
和目标分支之间的合并提交(例如 master
)。
您可以将其视为“未来”提交。 GitHub(以及其他 Git-based 协作平台)使用此技术来确定拉取请求是否会成功合并所有通过的检查并且没有合并冲突。
Atlassian 对此 server-side 实现细节背后的原因有很好的解释 here:
When you view a pull request, you’re seeing what the resultant merge commit will actually look like. We do this by actually creating a merge commit behind the scenes, and showing you the difference between it and the tip of the target branch.
他们显然在谈论 Bitbucket,但同样适用于 GitHub。
refs/pull// head 指的是 PR 的负责人,但是 refs/pull//merge 呢,我没有找到任何 git 提交,在提交历史记录中显示为 /merge 的一部分。这个 /merge 对 PR 到底意味着什么,当 PR 有多个 cmmits 时,当 PR 打开时,当 PR 关闭时等
$ git ls-remote
From git@<repo url>
01c8cd97857c21cfc5d413bd64e3c0e8cc8fd03d HEAD
37b88346a9edb426f676d080be502a1d4349c499 refs/heads/PR1
6fda26f078c00adf518ec620e94f54daa85bb894 refs/heads/PR1-1
bd88e471db4127f066b3b2f1d699b8296ca62f6d refs/heads/PR5
25b5eec47ca186a778c93439cd81e8a4125b5d6f refs/heads/PR6
58a82cf11218991f8f544a14ef6c57d3963690ee refs/heads/PR7
a5831973e1a4561527551a8bc8a9d5f9436f004b refs/heads/Pr2
01c8cd97857c21cfc5d413bd64e3c0e8cc8fd03d refs/heads/develop
442c0bc7f8b3872660d48cbd42690be677314b94 refs/heads/master
37b88346a9edb426f676d080be502a1d4349c499 refs/pull/1/head
2db24e8a6a53ce006694c4c5db1886df44620372 refs/pull/1/merge
a5831973e1a4561527551a8bc8a9d5f9436f004b refs/pull/2/head
4ea1814dda65e2ca8572fbbc5da9cc8141391ab8 refs/pull/2/merge
6fda26f078c00adf518ec620e94f54daa85bb894 refs/pull/3/head
b6cde57523fc73ce08dd7e588eeb606c3f047136 refs/pull/3/merge
442c0bc7f8b3872660d48cbd42690be677314b94 refs/pull/4/head
58a82cf11218991f8f544a14ef6c57d3963690ee refs/pull/5/head
e4a82d455b8b8e81b70dfbf4f6d79a1fb5158cbb refs/pull/5/merge
bd88e471db4127f066b3b2f1d699b8296ca62f6d refs/pull/6/head
e8825e286aa9c36c04046c5d4ac85c9d7a4ebf5c refs/pull/6/merge
25b5eec47ca186a778c93439cd81e8a4125b5d6f refs/pull/7/head
ed262d8c4766b037207f3113b634c777b3a0af37 refs/pull/7/merge
例如。 25b5eec47ca186a778c93439cd81e8a4125b5d6f refs/pull/7/头 ed262d8c4766b037207f3113b634c777b3a0af37 refs/pull/7/merge/
ed262d8c4766b037207f3113b634c777b3a0af37 的意义是什么 refs/pull/7/merge/ 并且在任何地方都找不到此提交 ID ed262d8c4766b037207f3113b634c777b3a0af37
refs/pull/<number>/merge
是由 GitHub 创建的参考,用于跟踪合并拉取请求后会发生什么。它引用 refs/pull/<number>/head
和目标分支之间的合并提交(例如 master
)。
您可以将其视为“未来”提交。 GitHub(以及其他 Git-based 协作平台)使用此技术来确定拉取请求是否会成功合并所有通过的检查并且没有合并冲突。
Atlassian 对此 server-side 实现细节背后的原因有很好的解释 here:
When you view a pull request, you’re seeing what the resultant merge commit will actually look like. We do this by actually creating a merge commit behind the scenes, and showing you the difference between it and the tip of the target branch.
他们显然在谈论 Bitbucket,但同样适用于 GitHub。