How to git-cherry-pick only changes to certain files?

Posted by Editorial Staff | Updated on

How to git-cherry-pick only changes to certain files? I’d do it with cherry-pick -n (–no-commit) which lets you inspect (and modify) the result before committing:

If the vast majority of modifications are things you don’t want, instead of checking out individual paths (the middle step), you could reset everything back, then add in what you want:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers