git pull: replace local version with the remote version

后端 未结 3 591
谎友^
谎友^ 2021-01-30 17:43

There is something I don\'t understand with the git pull command. I have a foobar Git repository with two files, named f1 and f2

3条回答
  •  心在旅途
    2021-01-30 18:32

    To reset specific files, use git checkout:

    git checkout HEAD f1
    git checkout HEAD f2
    

    You could possibly also use wildcards (*), but I've never tried.

    Similar question: How to checkout only one file from git repository?

    Resource on git checkout: http://gitready.com/beginner/2009/01/11/reverting-files.html

提交回复
热议问题