Re: How to pull only a few files from one branch to another?
- From
Daniel Barkalow <barkalow@iabervon.org>
- Date
- Jan 24, 2007, 05:29 UTC
- Message-ID
- <Pine.LNX.4.64.0701240019250.20138@iabervon.org>
- In-Reply-To
- <17846.53626.895660.762096@lisa.zopyra.com>
On Tue, 23 Jan 2007, Bill Lear wrote:
> I have a long-running topic branch. I have fixed a few nits on > the master branch that I would like on the topic branch. How do I > pull in only a few files from the head of the master branch?
You don't pull in a few files, you apply the changes made in a few commits:
git diff HEX_OF_NIT_FIX^ HEX_OF_NIT_FIX | git apply
If there's other stuff in the nit-fixing commit, shame on you, but you can edit the patch before applying it to remove everything that's not what you want.
(Incidentally, I think "git diff ^ {commit}" should be made to do "git diff {commit}^ {commit}"; i.e., if there is a single other revision provided, interpret a modifier not applied to anything as applying to that revision, in the "what else could that possibly mean?" department.)
-Daniel *This .sig left intentionally blank*