我有一个文件存在于 branch_A 但在 branch_B 中不存在。
我想跑
> git checkout branch_B
> git blame branch_A file
但是,git 抱怨我在本地没有该文件 - 这是正确的,但忽略了我想归咎于 branch_A 的事实。我希望 git blame 能够检查相对于所需分支而不是签出分支的文件是否存在。
如果我在分支 B 上运行它,我可以欺骗 git blame 来做我想做的事:
> touch file
> git blame branch_A file
有没有一种简单的方法可以做到这一点?