归咎于不同位置的文件的早期版本
有一次我的 git 存储库的路径被重新组织了。
我经常想在移动之前对文件进行修订。
指责当前存储库中不存在的文件的 git Blame 咒语是什么?
我尝试过:
> git blame new/path/to/file old_rev
fatal: no such path ... in old_rev
> git blame old/path/to/file old_rev
fatal: cannot stat path ... in old_rev
> git blame old_rev:old/path/to/file old_rev
fatal: cannot stat path ... in old_rev
显然我可以检查 old_rev 并责怪适当的路径,但我宁愿避免这种情况。
At one point my git repository had its paths reorganized.
I often want to do a blame on a file at a revision before the move.
What's the git blame incantation to blame a file that doesn't exist in the current repository?
I tried:
> git blame new/path/to/file old_rev
fatal: no such path ... in old_rev
> git blame old/path/to/file old_rev
fatal: cannot stat path ... in old_rev
> git blame old_rev:old/path/to/file old_rev
fatal: cannot stat path ... in old_rev
Clearly I could just check out old_rev and blame the appropriate path, but I'd rather avoid that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 gitblame --follow 来让blame跟随您的重命名。
我还发现您的参数顺序错误,请尝试以下操作:
You can use
git blame --follow
to make blame follow your renames.I also see your parameters are in the wrong order, try the following: