Skip to content

Instantly share code, notes, and snippets.

@gianpaolof
Last active October 9, 2019 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gianpaolof/6a18ad05fe86810e81d00823f72d1858 to your computer and use it in GitHub Desktop.
Save gianpaolof/6a18ad05fe86810e81d00823f72d1858 to your computer and use it in GitHub Desktop.
cherry pick from a remote repository
#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
@gianpaolof
Copy link
Author

gianpaolof commented Oct 9, 2019

faster way:
git fetch && git cherry-pick a54af62ed1c0643d27a1c0c089c62c0075c51c22
link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment