简体   繁体   English

如何查看提交之间已删除的更改

[英]How to see deleted changes between commits

I am using a repository for a tex files.我正在使用 tex 文件的存储库。 By using wrong software I have now inconsistent files.通过使用错误的软件,我现在有不一致的文件。

My question is how to see deleted changes between commits.我的问题是如何查看提交之间已删除的更改。 I have narrowed the problem down to about 30 commits in 3 branches.我已将问题缩小到 3 个分支中的大约 30 个提交。 Between those I would like to see the changes to all files in all lines.在这些之间,我希望看到所有行中所有文件的更改。 Especially those lines were added but later disappeared.特别是那些行被添加但后来消失了。

Sadly I have whole paragraph in one line, so I may need the word comparison instead of line as well.可悲的是,我在一行中有整个段落,所以我可能还需要单词比较而不是行。

Let say I have commits:假设我有承诺:

  • Comm5通讯5

  • Comm4通讯4

  • Comm3通讯3
  • Comm2通讯2
  • Comm1通讯1

and I want to see the added lines between Comm1 and Comm5 that has not existed in Comm1 and no longer exist in Comm5我想看到的添加的行Comm1Comm5已经没有存在的Comm1和不再存在Comm5

I am ok, with the result where I would have all lines duplicated and I would have to manually correct them, I just don't want to miss anything.我很好,结果我会复制所有行并且我必须手动更正它们,我只是不想错过任何东西。

Any Advice?有什么建议吗?

Assuming the commits are contiguous, git log 's --patch option can be useful here:假设提交是连续的, git log--patch选项在这里很有用:

git log --patch commit1 commit5

will show commit messages alongside diffs for each commit.将在每次提交的差异旁边显示提交消息。

Alternatively, it might be better to constrain by file instead of by commit:或者,最好通过文件而不是通过提交进行约束:

git log --patch -- my-file.tex

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

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