I have the most up-to-date code for a sub folder: "Folder-A" in the master. I have another branch: "Branch-A" that has same folder, but not up-to-date code. I am trying to merge that specific folder: "Folder-A" from the master to branch: "Branch-A". What is the git command to accomplish this? I would appreciate if someone can help me on that.
Asked
Active
Viewed 537 times
0
-
Possible duplicate of [How do I merge a sub directory in git?](http://stackoverflow.com/questions/1214906/how-do-i-merge-a-sub-directory-in-git). The result isn't actually a merge of your two branches; it's just overwriting Branch-A's version with master's version. So you'd lose any changes that Branch-A made to Folder-A. – cmbuckley Nov 19 '14 at 17:45
-
1I'm not clear on why a run-of-the-mill `git merge origin/master` won't do. – isherwood Nov 19 '14 at 18:11
1 Answers
0
Since the two branches are local, follow these steps.
Switch to Branch-A
:
git checkout Branch-A
Merge from master
:
git merge master
If there were no merge conflicts, this is it. If there are merge conflicts, you will need to resolve the conflicts and commit changes. At this point, all changes from master
will be available in Branch-A
, including making the outdated folder Folder-A
current.
If you want to just merge the contents of a subdirectory and not merge changes outside of that subdirectory, use one of the techniques outlined in the answer to this question.

Community
- 1
- 1