Last active
October 9, 2019 09:18
-
-
Save gianpaolof/6a18ad05fe86810e81d00823f72d1858 to your computer and use it in GitHub Desktop.
cherry pick from a remote repository
This file contains 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
#clone myrepo | |
git clone https://github.com/gianpaolof/myrepo.git | |
#cd into the repo folder | |
cd myrepo | |
# Add the repo from where we will cherry-pick | |
git remote add remoterepo https://github.com/remotegianpaolof/remote.git | |
#fetch the branches | |
git fetch remoterepo | |
# List commits of the branch we are interested | |
$ git log remoterepo/devbranch | |
# Cherry-pick the commit we need (don't worry it's a fake hash ^_^ ) | |
$ git cherry-pick a54af62ed1c0643d27a1c0c089c62c0075c51c22 | |
# Push to the branch we want | |
$ git push origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
faster way:
git fetch && git cherry-pick a54af62ed1c0643d27a1c0c089c62c0075c51c22
link