git 查找重复提交(通过 patch-id) [英] git finding duplicate commits (by patch-id)
问题描述
我想要一个查找重复更改的方法.patch-id 可能相同,但提交属性可能不同.
I'd like a recipe for finding duplicated changes. patch-id is likely to be the same but the commit attributes may not be.
这似乎是 patch-id 的预期用途:
This seems to be an intended use of patch-id:
git patch-id --help
git patch-id --help
IOW,你可以用这个东西来寻找可能的重复提交.
IOW, you can use this thing to look for likely duplicate commits.
我想将git log"、git patch-id"和 uniq 串在一起可能做得不好,但如果有人有一个命令干得好,我将不胜感激.
I imagine that stringing together "git log", "git patch-id" and uniq could do the job badly but if someone has an command that does the job well, I'd appreciate it.
推荐答案
因为重复的修改很可能不在同一个分支上(除非它们之间有reverts),你可以使用git cherry:
Because the duplicate changes are likely to be not on the same branch (except when there are reverts in between them), you could use git cherry:
git cherry [-v] [<upstream> [<head> [<limit>]]]
upstream
将是检查 head
中重复更改的分支.
Where upstream
would be the branch to check for duplicates of changes in head
.
这篇关于git 查找重复提交(通过 patch-id)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!