Last active
August 29, 2015 14:13
-
-
Save lcaballero/9832047130a786807204 to your computer and use it in GitHub Desktop.
One-liner that commit's a change via a SHA from one local git dir to another.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This one-liner commits a change from another local dir to the current repo. | |
# It uses a patch file to export the change and the does a 3 way commit. | |
# Found here: http://stackoverflow.com/questions/5120038/is-it-possible-to-cherry-pick-a-commit-from-another-git-repository | |
$ git --git-dir=../some_other_repo/.git \ | |
format-patch -k -1 --stdout <commit SHA> | \ | |
git am -3 -k |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment