Created
July 6, 2022 20:10
-
-
Save IaroslavR/c94d45f6c4d830c0f0372edc72dd5ebc to your computer and use it in GitHub Desktop.
cherry-pick commit from a different repo
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
# based on https://stackoverflow.com/q/5120038/4249707 | |
# local source | |
SRC=../<repo>/.git | |
COMMIT=<hash> | |
git --git-dir=${SRC} format-patch -k -1 --stdout ${COMMIT} | git am -3 -k | |
# remote source | |
[email protected]:<user>/<repo>.git | |
NAME=commit-source | |
git remote add ${NAME} ${REMOTE} | |
git fetch ${NAME} | |
git log ${NAME}/master | |
git cherry-pick <hash> | |
git remote remove ${NAME} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment