git/list[1] front-page[2] threads[3] people[4] search[5] about
 

How to install and use a custom merge driver

From
ACAlec Clews <alec.clews@gmail.com>
Date
Jan 28, 2009, 03:10 UTC
Message-ID
<497FCC9A.9080008@gmail.com>
Background:

I want to use git to track the delivery of patch files into existing file trees. This means that new files will need to be copied over existing files (especially in the case of binary files or textual conflicts)

To this end I want to use a custom merge driver (actually the cp command)
Setup:
I have set up my ..git/info/gitattributes as follows
*      merge=overwrite
I have defined in .git/config
[merge "overwrite"]
    name = overwrite using cp
    driver = cp %B %A
Problem:

However when I perform a git merge the default merge is being called. Is there something else needed to make git perform the copy operation?

Many thanks
-- 
Alec Clews
Personal <alec.clews@gmail.com>			Melbourne, Australia.
Jabber:  alecclews@jabber.org.au		PGPKey ID: 0x9BBBFC7C
Blog  http://alecthegeek.wordpress.com/
Next: Jeff King
Message 1 of 9 in “How to install and use a custom merge driver”
  1. Alec ClewsJan 28, 2009
  2. Jeff KingJan 28, 2009
  3. Alec ClewsJan 28, 2009
  4. Alec ClewsJan 28, 2009
  5. Jeff KingJan 29, 2009
  6. Alec ClewsJan 29, 2009
  7. Jeff KingJan 29, 2009
  8. Alec ClewsJan 29, 2009
  9. Jeff KingJan 29, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.