Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git将主机合并到分支提交顺序中_Git_Github_Merge - Fatal编程技术网

Git将主机合并到分支提交顺序中

Git将主机合并到分支提交顺序中,git,github,merge,Git,Github,Merge,我有一个GIT主分支,具有以下提交 Master:- commit one commit two 现在我创建了一个新的分支sprint1并添加了以下内容 Sprint1: commit one commit two commit sprint1 one 大师和斯普林特在这一点上分歧了 Master: commit one commit two commit three Sprint1:

我有一个GIT主分支,具有以下提交

Master:-
      commit one
      commit two
现在我创建了一个新的分支sprint1并添加了以下内容

Sprint1:
      commit one
      commit two
      commit sprint1 one
大师和斯普林特在这一点上分歧了

Master:
      commit one
      commit two
      commit three

Sprint1:
      commit one
      commit two
      commit sprint1 one
      commit sprint1 two
      commit sprint1 three
现在,当我将master合并到sprint1中时,我得到以下结果:

Sprint1
      commit one
      commit two
      commit sprint1 one
      commit three
      commit sprint1 two
      commit sprint1 three
      commit merged commit
但当我将master合并到sprint1中时,我预期会出现以下情况:-

Sprint1
      commit one
      commit two
      commit sprint1 one
      commit sprint1 two
      commit sprint1 three
      commit three
      commit merged commit

这是前者,而不是后者。

根据文档,提交是按相反的时间顺序显示的

要按预期的顺序进行提交,请尝试使用:

git log --oneline --topo-order
这样可以避免在混合的多行历史记录上显示提交

有关更多详细信息,请参阅:

您还可以使用
--graph
获得更好的输出,并单独显示分支。这意味着默认情况下,
--topo order
选项

我有时更喜欢通过别名使用的快速日志版本是:

git --no-pager log --decorate=short --pretty=oneline --abbrev-commit --graph -n 10

您如何查看提交顺序?github?终点站?其他一些git工具?命令行终端..git log--oneline..哪一个是正确的顺序,“提交三个”是在“sprint 1两个”和“sprint 2三个”之前完成的我使用的是分隔分支提交的
git log--oneline--graph
,将它们按顺序排列这个命令真的很有帮助..正如预期的那样..让我重新创建并查看..非常感谢。。