How to merge specific files from another branchFeb 06, 2019 · by Tim Kamanin
Let's say you have a branch
dev and in that branch, you have a file
graphql.config.json and you want to merge it into your master. How do you do that?
Despite working with git for about ten years, I didn't know about this one until now. And it turned out to be as simple as:
git checkout dev graphql.config.json
Note: You need to be in your target branch while running this command (in master in my case).
What's even cooler, you can merge more than a single file:
git checkout dev graphql.config.json app/fixtures.json bin/sync.sh
Not bad, huh?