Git/Pull a Patch from a Single Commit or Cherry-picking

From Debuntu

< Git
Jump to: navigation, search

Let say somebody else cloned your repo and did some changes that you want to merge to your code.

In the meantime, you have done some modifications to other which would be removed if you were merging.

This is where cheery-picking will come to the rescue:

$ git fetch git://user@host/repo.git
$ git cherry-pick ABCDEFG

were ABCDEFG is the commit you want to pull in.

Another way of doing it is to first track a remote repository, fetch it and then get the commit cherry-picked:

$ git remote add remoterepo  git://user@host/repo.git
$ git fetch remoterepo
$ git cherry-pick ABCDEFG
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
Google AdSense