Is it possible to pull just one file in Git?

后端 未结 5 1033
北海茫月
北海茫月 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条回答
  •  不知归路
    2020-11-30 16:54

    You can fetch and then check out only one file in this way:

    git fetch
    git checkout -m  
    git add 
    git commit
    

    Regarding the git checkout command: - a branch name, i.e. origin/master does not include the repository name (that you can get from clicking copy path button on a file page on GitHub), i.e. README.md

提交回复
热议问题