How to merge specific files from Git branches

后端 未结 11 1854
长发绾君心
长发绾君心 2020-11-30 16:23

I have 2 git branches branch1 and branch2 and I want to merge file.py in branch2 into file.py in branch1 and only that file.

In essence I just want to work on the fi

11条回答
  •  自闭症患者
    2020-11-30 16:43

    The simplest solution is:

    git checkout the name of the source branch and the paths to the specific files that we want to add to our current branch

    git checkout sourceBranchName pathToFile
    

提交回复
热议问题