diff --git a/git/cherry-picking-commits-from-another-branch.md b/git/cherry-picking-commits-from-another-branch.md new file mode 100644 index 0000000..aca10c3 --- /dev/null +++ b/git/cherry-picking-commits-from-another-branch.md @@ -0,0 +1,13 @@ +You have a commit which contains a good code change but it is in another branch? + +``` +# pick the commit +git cherry-pick + +# apply changes introduced by commit but do not commit the changes +git cherry-pick -n +git cherry-pick --no-commit + +# pick all the commits from A to B +git cherry-pick A^..B +```