简体   繁体   English

VSO git文件历史记录中的“简单历史记录(默认)”和“完整历史记录”有什么区别?

[英]What's the difference between 'Simple History(default)' and 'Full History' in VSO git file history?

In VSO git repository, on file history, there are filter options of 'Simple history(default)', 'First parent', 'Full history' and 'Full history(simplify merges). 在VSO git存储库中,在文件历史记录上,有“简单历史记录(默认)”,“第一父级”,“完整历史记录”和“完整历史记录(简化合并)”的过滤器选项。 What's the difference among these options? 这些选项之间有什么区别? and what's the difference between 'Simple history' and 'Full hisotry'. “简单的历史记录”和“完整的历史记录”之间有什么区别?

We have like below commits showing in simple history. 我们喜欢下面的提交,显示了简单的历史记录。 A--B--C--D--E--F But, after one of our developers run command "get reset --hard origin/develop", in Simple history, there are only commits A--B--C--D. A–B–C–D–E–F但是,在我们的一位开发人员运行命令“ get reset --hard origin / develop”之后,在简单历史记录中,仅提交了A–B--光盘。 E and F are missing. E和F丢失。 in 'Full history' we can still see commits A--B--C--D--E--F. 在“完整历史记录”中,我们仍然可以看到提交A–B–C–D–E–F。 the real problem, when run 'git pull' to pull latest code, we only get the code changes to commit D, and we cannot pull the code changes in E and F. 真正的问题是,当运行'git pull'来获取最新代码时,我们仅将代码更改提交到D,而无法在E和F中获取代码更改。

What should we do? 我们应该做什么? so, we get E, F back in simple history, and when run 'git pull', code changes in E and F can be pulled to local disk. 因此,我们可以在简单的历史记录中获得E,F,并且在运行“ git pull”时,可以将E和F中的代码更改拉至本地磁盘。

Git history simplification can be a confusing beast. 简化Git历史记录可能会令人困惑。 99% of the time you won't even know it exists, but every once in a while it will jump out of the dark corners of Git and bite you. 您有99%的时间甚至都不知道它的存在,但是偶尔,它会跳出Git的黑暗角落并叮咬您。 In this article we'll explore what history simplification is and how it can cause confusion when looking at file history. 在本文中,我们将探讨什么是历史记录简化以及在查看文件历史记录时如何引起混淆。

Let's start with a common scenario: 让我们从一个常见的场景开始:

You push a change to a file and then merge the change into master. 您将更改推送到文件,然后将更改合并到主文件中。 Some of your colleagues also merge their branches to master. 您的一些同事还将其分支合并到母版中。 You come back some time later and notice your changes are missing. 您稍后再回来,发现您的更改丢失了。 Looking for the culprit, you go look at the file history and notice... your changes aren't even listed!? 寻找罪魁祸首,您去查看文件历史记录并注意到...您的更改甚至都没有列出! What is happening here is that Git commit history is a tree, and sometimes the chronological history is not the same as the actual file tree history. 这里发生的是Git提交历史是一棵树,有时时间顺序历史与实际的文件树历史不同。 This is particularly true in cases where a merge commit reverts a file back to its original state. 在合并提交将文件还原回其原始状态的情况下尤其如此。 In that case, the default history view won't actually show you all changes, because technically the file didn't change. 在这种情况下,默认的历史记录视图实际上不会显示所有更改,因为从技术上说,文件没有更改。

In the above scenario, Git realizes it can simplify the history and the "changes" you are most likely looking for are removed from the log. 在上述情况下,Git意识到它可以简化历史记录,并且您最有可能寻找的“更改”将从日志中删除。

Unless you have run into it before, the result is often a lot of hair pulling and wondering Where the heck did my changes go? 除非您之前碰到过它,否则结果通常是很多头发拉扯着,想知道我的更改到底去了哪里?

Source and more details: https://www.visualstudio.com/en-us/articles/git-log-history-simplification 来源和更多详细信息: https : //www.visualstudio.com/zh-cn/articles/git-log-history-simplification

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM