How to Git merge a single folder or file from one branch to another

SupaDupaGuides
Mar 19, 2021

--

Quick-fire instructions to bring specific changes to another branch.

Git How to merge single folder or file to another branch

Run the command on the branch you want to bring code into:

git checkout --patch origin/[branch] [folder/path]

This will give you a list of “hunks” in your Vim editor.

Go through each hunk and choose which ones you want & which you don't.
Or manually edit if you partially want it.

--

--