gpt4 book ai didi

git - 归咎于不同位置的文件的早期版本

转载 作者:IT王子 更新时间:2023-10-29 01:15:32 24 4
gpt4 key购买 nike

有一次我的 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 并归咎于适当的路径,但我宁愿避免这种情况。

最佳答案

你可以使用 git blame --follow 让 blame 跟随你的重命名。

我还看到您的参数顺序错误,请尝试以下操作:

git blame old_rev -- old/path/to/file

关于git - 归咎于不同位置的文件的早期版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7587257/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com