检查 git 中是否有重复的文件(内容)?
在我的“项目/存储库”中,我有两个 MS Visual Studio 项目,一个用于主代码,另一个用于测试。我有一些两者通用的文件(在复制和粘贴意义上),我想查看/检查它们是哪些。
什么是正确的 Git 命令(或 GUI 菜单单击)来查看我是否在整个存储库树中使用了相同的内容 blob 两次?如果我正确阅读了所有教程,git 应该对相同文件内容的两个副本有一个 SHA1,并且已经知道它。我希望 Git 有一个命令可以查找并显示这些重复的使用文件路径。
最终,当存在共同祖先 blob SHA1(但不是共同位置)时,我希望能够找出版本之间的差异。 [即在测试过程中,一个版本先于另一个版本更新...]
我知道拥有此类重复项不是最佳实践,但这是工作结束的方式:-(
我在 Windows 上有 Msysgit 和 GitExtensions ...
In my 'project/repo' I have two MS Visual Studio projects, one for the main code, and an independent one for tests. I have some files that are common to both (in the copy and paste sense) and I'd like to see / check which ones they are.
What is the right Git commands (or Gui menu clicks) to see if I have used the same content blob twice in the overall repo tree? If I have read all the tutorials correctly, git should have a single SHA1 for the two copies of the same file content and already know about it. I am hoping Git has a command that finds and displays these duplicate usage file paths.
Eventually I'd like to be able to find out the diffs between the versions when there is a common ancestor blob SHA1 (but not a common location). [i.e. during testing one version gets updated ahead of the other version...]
I know it isn't best practice to have such duplicates, but it is the way the work has ended up :-(
I have Msysgit and GitExtensions on windows...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以执行类似
“查看 blob 和文件”之类的操作。
如果您不想手动查看哪些是相同的 blob:
来自: Git:在此树中查找重复的 blob(文件)
You can do something like
To see the blobs and the files.
If you don't want to manually look which are the same blobs:
From: Git: Find duplicate blobs (files) in this tree