如何始终显示Git的完整历史记录? [英] How to always show full-history in Git?

查看:178
本文介绍了如何始终显示Git的完整历史记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Intellij和命令行Git,但是由于Git默认不显示无趣的"更改,因此我们无法看到提交问题.

I'm using Intellij and command-line Git and we have problems with not seeing commits because Git defaults to not showing "uninteresting" changes.

例如,如果开发人员"A"更改了某些内容并推送了更改,那么开发人员"B"将其更改回原来的状态(在"A"更改之前)并推送了更改,则这些提交将不会显示在历史上,因为他们会互相抵消(至少这是向我解释的方式.)这使得很难发现问题,并导致很多我的零钱去了哪里?"

For example, if Developer "A" changes something and pushes the change, then Developer "B" changes it back to the way it was (before "A"'s change) and pushes that change, those commits would not show in the history because they would cancel each other out (at least this is the way it's been explained to me.) This makes it hard to find problems and leads to a lot of "Where'd my change go?"

理想情况下,默认情况下,Intellij和命令行都将显示完整的历史记录,所有提交(包括合并).

Ideally both Intellij and command-line would show full history, all commits, including merges, every time, by default.

有人知道在.gitconfig中完成此操作的设置吗?

Anyone know the settings to accomplish this in .gitconfig?

以下部分来自 git-log文档,并说明了我的内容意思是无趣的变化"

The following section is from the git-log documentation and explains what I mean by "uninteresting changes"

默认模式 将历史简化为最简单的历史,解释树的最终状态.最简单,因为如果最终结果相同,它将修剪一些侧分支(即合并具有相同内容的分支) -完整的历史 与默认模式相同,但不修剪某些历史记录.

Default mode Simplifies the history to the simplest history explaining the final state of the tree. Simplest because it prunes some side branches if the end result is the same (i.e. merging branches with the same content) --full-history Same as the default mode, but does not prune some history.

推荐答案

要使用git log显示完整的历史记录,请使用--sparse--full-history开关调用它.

To show full history with git log invoke it with the --sparse and --full-history switches.


--sparse

    All commits that are walked are included.

    Note that without --full-history, this still simplifies merges: if one of
    the parents is TREESAME, we follow only that one, so the other sides of the
    merge are never walked.

请注意,无法指定git命令的默认标志因此您将必须为命令行git use创建别名.我不知道IntelliJ是否支持git log的这种设置.

Note that there is no way to specify default flags for git commands so you will have to create an alias for your command line git use. I am not aware of IntelliJ supporting such setup for git log.

这篇关于如何始终显示Git的完整历史记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆