How do I merge a sub directory in Git?

前端 未结 6 904
太阳男子
太阳男子 2020-11-27 11:08

Is it possible to merge only the changes for a sub-directory from a local Git branch to a remote Git branch or is it "all or nothing"?

For example, I have:<

6条回答
  •  时光说笑
    2020-11-27 12:06

    Create a Git repository to contain both branch-a and branch-b:

    git checkout branch-a
    git diff branch-b dir-1 > a.diff
    patch -R -p1 < a.diff
    

提交回复
热议问题