Is it possible to pull just one file in Git?

后端 未结 5 1006
北海茫月
北海茫月 2020-11-30 16:43

I am working on a Git branch that has some broken tests, and I would like to pull (merge changes, not just overwrite) these tests from another branch where they are already

5条回答
  •  -上瘾入骨i
    2020-11-30 17:09

    Here is a slightly easier method I just came up with when researching this:

    git fetch {remote}
    git checkout FETCH_HEAD -- {file}
    

提交回复
热议问题