cherry-pick'ing From Another Repo

Posted on 17 Oct 2012 by Eric Oestrich

Cherry picking

We’re in the process of splitting out a fairly large rails app that contains very clear “mini” apps. Each “mini” app will get their own full app and of course their own git repo.

As we split out the multiple apps, some commits were bound to be missed because others continued working in the main repo. After doing a bit of searching I found that there was a nice way to import these commits via cherry-pick.


git remote add other-repo ../other-repo/
git fetch other-repo
git cherry-pick cf0dbfe3c63ab0f49bb8fa97d3b28bb0bd9eb896

I’ve ended up using this trick several times this week and it’s turned out to be an excellent time saver.

Resources
  1. StackOverflow
  2. git-cherry-pick
  3. Photo by InGale2005
comments powered by Disqus
Creative Commons License
This site's content is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License unless otherwise specified. Code on this site is licensed under the MIT License unless otherwise specified.