Git: How to pull a single file from a server repository in Git?

后端 未结 8 1095
小蘑菇
小蘑菇 2021-01-29 17:57

I am working on a site with a server running Git. I am using Git for deployment (not GitHub). This was set up prior to my involvement using a hook method, and I referred to this

8条回答
  •  闹比i
    闹比i (楼主)
    2021-01-29 18:28

    It is possible to do (in the deployed repository):

    git fetch
    // git fetch will download all the recent changes, but it will not put it in your current checked out code (working area).
    

    Followed by:

    git checkout origin/master -- path/to/file
    // git checkout / -- path/to/file will checkout the particular file from the downloaded changes (origin/master).
    

提交回复
热议问题