Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
A假设我有一个带有分支和分支的 Git 存储库B。 分支B当前已签出(即.git/HEAD包含refs/heads/B)。 现在,不检查分支A,如何查看分支的历史(日志path/file)A?
A
B
.git/HEAD
refs/heads/B
path/file
接下来git help rev-parse,我尝试使用git log A:path/file,但这似乎不起作用(不输出任何内容)。为什么?
git help rev-parse
git log A:path/file
试试这个(不带尖括号):
git log <branch> -- <path/to/file>