Last Updated: September 13, 2016
· jodosha

Git cherry-pick from another repository

Let's say you want to apply some patches from someone else repository:

# Cloning our fork
$ git clone git clone

# Adding (as "endel") the repo from we want to cherry-pick
$ git remote add endel git://

# Fetch their branches
$ git fetch endel

# List their commits
$ git log endel/master

# Cherry-pick the commit we need
$ git cherry-pick 97fedac

# Pushing to our master
$ git push origin master

4 Responses
Add your response


Excellent, just what I needed. I needed to change git:// to git@ for this to work for me.

over 1 year ago ·

Or light version:
git fetch <remote-git-url> <branch> && git cherry-pick SHA1

For example:
git fetch && git cherry-pick 20258def3280b4ccba286c4a021140c66292ebc0

over 1 year ago ·

Simple & great

over 1 year ago ·

Thank you for your tip!

some trivial errors
1. git clone git clone => git clone
2. git remote add endel git:// => git remote add endel

over 1 year ago ·
Filed Under