什么是git边界提交

时间:2017-02-24 11:33:06

标签: git

git log command--boundary选项,导致程序

  

输出排除的边界提交。

但什么是边界提交?我什么时候想把它们包含在输出中?

2 个答案:

答案 0 :(得分:4)

边界提交是限制修订范围但不属于该范围的提交。例如,修订范围HEAD~3..HEAD包含3个提交(HEAD~2HEAD~1HEAD),并且提交HEAD~3充当其边界提交

更正式地说,git通过从指定的提交开始并通过父链接获得其他提交来处理修订范围。它停止在不符合选择标准的提交中(因此应该被排除) - 这些是边界提交。

插图:

$ mkdir test
$ cd test
$ git init
Initialized empty Git repository in ~/playground/git/test/.git/
$ touch a
$ git add a
$ for i in {1..5}; do echo $i >> a; git commit -m "Commit #$i" a; done
[master (root-commit) bf958f1] Commit #1
 1 file changed, 1 insertion(+)
 create mode 100644 a
[master 3721a8b] Commit #2
 1 file changed, 1 insertion(+)
[master d69efcc] Commit #3
 1 file changed, 1 insertion(+)
[master 72cd21d] Commit #4
 1 file changed, 1 insertion(+)
[master 17ae9c3] Commit #5
 1 file changed, 1 insertion(+)
$ git log --oneline
17ae9c3 Commit #5
72cd21d Commit #4
d69efcc Commit #3
3721a8b Commit #2
bf958f1 Commit #1
$ git log --oneline HEAD~3..
17ae9c3 Commit #5
72cd21d Commit #4
d69efcc Commit #3
$ git log --oneline HEAD~3.. --boundary
17ae9c3 Commit #5
72cd21d Commit #4
d69efcc Commit #3
- 3721a8b Commit #2     <-- This is the boundary commit HEAD~3 that would
                            not be included in the output had the '--boundary'
                            option NOT been provided

答案 1 :(得分:-1)

  

--boundary

     

--boundary参数是显示提交的上下文(父修订版)。

边界提交是一个不属于&#34;框架的提交。在哪个命令执行。 ( - 因此,提交范围等)

例如,如果您使用–since=3.weeks之类的参数,则在三周之前提交 会被视为 boundary commits 。通常boundary次提交标有-

enter image description here

您可以在上面的屏幕截图中看到,最后一次提交是&#34;已经消失了#34;在第二个日志中。它归因于--boundary标志

您可以看到提交前有一个o符号,而不是常规提交中的*

相关问题