{"thread":{"id":"10178","subject":"How to pick a commit from another git tree?","startedAt":"2007-10-07T17:31:00Z","lastAt":"2007-10-07T20:10:48Z","messageCount":3,"participants":["Joakim Tjernlund","Pierre Habouzit","Alex Riesen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"55074","messageId":"000101c80907$d461a810$04ac10ac@Jocke","threadId":"10178","inReplyTo":null,"subject":"How to pick a commit from another git tree?","fromName":"Joakim Tjernlund","fromEmail":"joakim.tjernlund@transmode.se","sentAt":"2007-10-07T17:31:00Z","receivedAt":"2007-10-07T17:31:00Z","isPatch":false,"sender":{"key":"joakim.tjernlund@transmode.se","avatar":null},"body":"Hi \n\nThis is probably a somewhat stupid question but I havn't had a need until now so here goes:\nThere is a commit in David Millers tree:\nhttp://git.kernel.org/?p=linux/kernel/git/davem/bak-net-2.6.24.git;a=commit;h=bbb4c0c35a4c2aed5e025b668c8dfc99c5b74cff\nthat hasn't made it into 2.6.23, but will go into 2.6.24. \nI need this fix on top of 2.6.23(once it is released).\nNow I wonder how to best add this fix to my tree. Once this fix hits linus tree and I pull\nlinus tree, I don't wan't a conflict as I already have this fix in my tree.\n\nShould I just pull Davids tree? Or should I cherry-pick this one commit?\nOr something else?\n\n Jocke\n"},{"id":"55075","messageId":"20071007175013.GH10024@artemis.corp","threadId":"10178","inReplyTo":"000101c80907$d461a810$04ac10ac@Jocke","subject":"Re: How to pick a commit from another git tree?","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2007-10-07T17:50:13Z","receivedAt":"2007-10-07T17:50:13Z","isPatch":false,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Sun, Oct 07, 2007 at 05:31:00PM +0000, Joakim Tjernlund wrote:\n> Hi \n> \n> This is probably a somewhat stupid question but I havn't had a need until now so here goes:\n> There is a commit in David Millers tree:\n> http://git.kernel.org/?p=linux/kernel/git/davem/bak-net-2.6.24.git;a=commit;h=bbb4c0c35a4c2aed5e025b668c8dfc99c5b74cff\n> that hasn't made it into 2.6.23, but will go into 2.6.24. \n> I need this fix on top of 2.6.23(once it is released).\n> Now I wonder how to best add this fix to my tree. Once this fix hits linus tree and I pull\n> linus tree, I don't wan't a conflict as I already have this fix in my tree.\n> \n> Should I just pull Davids tree? Or should I cherry-pick this one commit?\n> Or something else?\n\n  The easiest way is to fetch his tree (git remote add ...; git fetch)\nand then yes, cherry-pick the commit(s) you need.\n\n  If you need more than one commit, you can use:\n\n  git rebase --onto <your tip> fromCommit toCommit\n\n  and it will move ]fromCommit..toCommit] onto <your tip>\n\n  It's likely that the fetch will be quite cheap as I suppose that David\nMillers tree as very few objects different from linus tree (compared to\nthe linux2.6 git repository size I mean).\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"55083","messageId":"20071007201048.GA2765@steel.home","threadId":"10178","inReplyTo":"000101c80907$d461a810$04ac10ac@Jocke","subject":"Re: How to pick a commit from another git tree?","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-10-07T20:10:48Z","receivedAt":"2007-10-07T20:10:48Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Joakim Tjernlund, Sun, Oct 07, 2007 19:31:00 +0200:\n> This is probably a somewhat stupid question but I havn't had a need until now so here goes:\n> There is a commit in David Millers tree:\n> http://git.kernel.org/?p=linux/kernel/git/davem/bak-net-2.6.24.git;a=commit;h=bbb4c0c35a4c2aed5e025b668c8dfc99c5b74cff\n> that hasn't made it into 2.6.23, but will go into 2.6.24. \n> I need this fix on top of 2.6.23(once it is released).\n\n$ git fetch git://git.kernel.org/pub/scm/linux/kernel/git/davem/bak-net-2.6.24.git\n$ git cherry-pick bbb4c0c35a4c2aed5e025b668c8dfc99c5b74cff\n\n> Now I wonder how to best add this fix to my tree. Once this fix hits linus tree and I pull\n> linus tree, I don't wan't a conflict as I already have this fix in my tree.\n\nDepending on the state the Davids tree ends up when it is merge into\nLinus' tree you may or may not get a conflict. It is not in your hands\neither way.\n\n> Should I just pull Davids tree? Or should I cherry-pick this one commit?\n> Or something else?\n\nI would just cherry-pick it, and revert it (or hard-reset my tree to\nLinus' tree) if it conflicts later.\n"}]}