# how to apply diff between A and B to a file?

2 messages from 2008-02-25 to 2008-02-25. Participants: Denis Shaposhnikov, Jakub Narebski.
Thread: https://gitlist.dev/t/12313

## Denis Shaposhnikov, 2008-02-25 18:43

Subject: how to apply diff between A and B to a file?
Message-ID: <20080225214326.353d0e95@wizard.volgograd.ru>
URL: https://gitlist.dev/e/20080225214326.353d0e95%40wizard.volgograd.ru

```
Hello,

With svn I used a command "svn merge -r A:B some/file" to apply diff
between revisions A and B to file some/file. I done it in one branch,
in trunk for example. Is it possible to do such thing with git?

Thanks!

-- 
DSS5-RIPE DSS-RIPN mailto:dsh@wizard.volgograd.ru xmpp:dsh@vlink.ru
http://wizard.volgograd.ru/ 2:550/5068@fidonet 2:550/5069@fidonet

```

## Jakub Narebski, 2008-02-25 18:58

Subject: Re: how to apply diff between A and B to a file?
Message-ID: <m3fxvgc18q.fsf@localhost.localdomain>
URL: https://gitlist.dev/e/m3fxvgc18q.fsf%40localhost.localdomain
In-Reply-To: <20080225214326.353d0e95@wizard.volgograd.ru>

```
Denis Shaposhnikov <dsh@wizard.volgograd.ru> writes:

> Hello,
> 
> With svn I used a command "svn merge -r A:B some/file" to apply diff
> between revisions A and B to file some/file. I done it in one branch,
> in trunk for example. Is it possible to do such thing with git?

Not using "git merge", which is by design whole tree opration in
Git. It must be, to support rename detection.

You can, however, do the following:

  $ git diff A B -- some/file | git apply --index

(not tested!).
-- 
Jakub Narebski
Poland
ShadeHawk on #git

```
