Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
168 views
in Technique[技术] by (71.8m points)

git blame,如何基于某个 commit id 进行?

比如我想知道 7cd1590560e2232adbff91ff18c0e97bb85062e0 这个 commit id 时,xxx.go 文件的 git blame 结果,该怎么做?
注意不是直接 git blame xxx.go,而是要站在某次提交上看


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

手册上好像没看到这个用法,不过你可以先创建一个分支

然后使用 git checkout 7cd1590560e2232adbff91ff18c0e97bb85062e0 xxx.go ,把文件且回到指定版本,然后再执行 git blame xxx.go


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...