On Wednesday, June 17, 2009, Alberto Leal <[email protected]> wrote: > Hi folks, > > I've been using 'git cherry-pick' and 'git am' for a long time. But sometimes > I get confused and don't know which command I choose. > > For example: > > I had two different trees and I wanted to apply some commits from one to > each other. I tried to use 'git format-patch' to get the patches files and > apply them using 'git am', but I had no success and I couldn't see the > conflicts. Thus, I used 'git cherry-pick' and got success - without conflicts. > > So, my question is: When do I prefer to use 'git cherry-pick' over 'git am'?
Use cherry-pick when you have the commit objects in your local git db, i.e. when 'git show SHA' works. Use am when you don't have the object locally and someone has sent you a format-patch style patch over email or the web. Cheers, Chris -- Chris Wanstrath http://github.com/defunkt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "GitHub" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/github?hl=en -~----------~----~----~----~------~----~------~--~---
