How can I show the contents of a file at a specific state of a git repo?

后端 未结 2 1031
猫巷女王i
猫巷女王i 2021-02-02 08:14

I want to show the contents of a file given by a path at a specific state of a git repo. I unsuccessfully tried this:

git show f825334150cd4bc8f46656b2daa8fa1e9         


        
2条回答
  •  不思量自难忘°
    2021-02-02 09:01

    It's probably problem with your path specification.

    This works, shows version of Makefile in commit b1b22df407417...

    git show b1b22df407417:Makefile
    

    Or current version in master branch

    git show master:Makefile
    

    Or current version in exper branch:

    git show exper:Makefile
    

    Or previous version on the exper branch:

    git show exper^:Makefile
    

    And so on

提交回复
热议问题