Git Trix - neal-erickson/dotfiles GitHub Wiki
Cherry Picking
- Get the commitShas of the commits you want to apply, e.g.
f586430
. Do them in the same order for sanity. - Go to branch you want to apply commit to and run:
git cherry-pick commitSha
- Fix any conflicts, if necessary
Options:
- Can use the
--no-commit
flag to simply apply the changes to the working tree without a commit
Patching
- Get a patch file created using
git diff {args} > mypatch.patch
- Diff working tree to last commit:
git diff
- Diff current branch to another branch:
git diff {other_branch_name}
- From destination branch, apply patch:
git apply {patch_file}