Reputation: 1
I have two branches A and B, B was branched off from A
there were different changes made on both A and B since then
I would like to know the git commands to move just one folder from A to B without pulling any other changes
Upvotes: 0
Views: 182
Reputation: 2696
How do I merge changes to a single file, rather than merging commits? is basically the same question, but many of the answers are wrong.
I fixed/improved some of the better solutions.
git checkout B
git format-patch --stdout ..A -- <path> | git am -3
git checkout B
git diff ...A -- <path> | git apply
# stage changes and commit
git checkout B
git checkout A -- <path>
# commit
Upvotes: 1