4
比方说,我有我的东西一个git回购目录myapp
内:Git的节目的文件路径
myapp
/.git
/.gitignore
/subdirA
/subdirB
/file1.txt
/file2.txt
/(and some other stuffs)
/(and some other stuffs)
我想从旧查看file1.txt
提交abcd123
。对于another thread,我才知道,我应该使用类似:
$ git show abcd123:path/to/file1.txt
然而,我感到困惑的正确的道路使用。我试着像
$ git show abcd123:myapp/subdirA/subdirB/file1.txt
$ git show abcd123:subdirA/subdirB/file1.txt
$ git show abcd123:subdirB/file1.txt
$ git show abcd123:file1.txt
但混帐一直给我像
$ Path 'subdirA/subdirB/file1.txt' does not exist in 'abcd123'
如何解决这个问题的错误消息?
你可以得到一个有效的路径列表int他承诺'git ls-tree -r --name-only abcd123' –
@ WumpusQ.Wumbley非常感谢。有用。我可以查看我现在需要的文件。在上面的例子中,路径“subdirA/subdirB/file1.txt”应该是正确的,但我可能错误地键入了路径,以致于收到错误消息。 – user740006
@ WumpusQ.Wumbley这是值得写一个答案) –