Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git pick changes from another branch

Tags:

git

I have 3 branches: master, featureA, featureB. I want to import a few changes(not necessarily in separate commits) from branch A into branch B, how do I do it? I guess I should use some command in an interactive mode, but I haven't figured out what would do.

like image 233
Dmitri Pisarev Avatar asked Sep 11 '25 12:09

Dmitri Pisarev


1 Answers

You'll want to use git cherry-pick.

You can do this declaratively, by specifying the commit hash to merge in on the command line.

If the changes are not necessarily full commits, git cherry-pick --no-commit followed by some editing and a git commit (or git commit --amend) is what you are after.

like image 156
David Pfeffer Avatar answered Sep 14 '25 03:09

David Pfeffer