我们最近将SVN存储库转换为GIT.似乎我们通过此转换丢失了一些提交,并希望验证这一点.
因此,我们希望为每个svn提交找到匹配的git提交,以检查转换是否实际发生.
$ git log|grep "some partial commit message" 这是不够的,因为它只是通过直接的先行者而忽略了不是直接祖先的分支.
$ git show <commit-hash> 不会工作,因为svn没有sha1sums.
我发现的最接近的事情是:$ git reflog show --all --grep="releasenotes"|xargs git show --shortstat然而这似乎并不完全有效,因为它似乎在更多的地方grep而不仅仅是提交消息(我们得到了误报).
我也试过用这个: $ git rev-list --all|xargs -n1 bash -c 'git show|head -n10'|grep -i release
基本上我没有一个很好的方法来打印没有差异的提交消息.
[编辑]
我不完全确定,但我想这应该列出存储库中的所有提交消息.
git rev-list --all|xargs -n1 git log -n1
Run Code Online (Sandbox Code Playgroud)
Pab*_*ook 12
你可以使用--all选项git log
git log --all --oneline --graph --decorate | grep "message"
Run Code Online (Sandbox Code Playgroud)
这相当于
git log --all --oneline --graph --decorate --grep "message"
Run Code Online (Sandbox Code Playgroud)
或者,如果您希望拥有上下文并且没有很多提交,那么您可能希望执行类似的操作
git log --all --oneline --graph --decorate | less
/ message
Run Code Online (Sandbox Code Playgroud)
而且这样你可以看到这里你是提交相对于其他的提交.
您可以使用以下--grep选项git log:
$ git log --all --grep=word
Run Code Online (Sandbox Code Playgroud)
请参阅" 如何为某个单词grep git提交 ":这用于grepping提交消息.
| 归档时间: |
|
| 查看次数: |
2669 次 |
| 最近记录: |