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

Re: Trouble with file specific merge strategies

From
suvayu ali <fatkasuvayu+linux@gmail.com>
Date
Mar 11, 2012, 18:01 UTC
Message-ID
<CAMXnza2vD+XOstbNbt+wJgAGE7OEDpQTqGL8NWjWd0fYkWbJ2w@mail.gmail.com>
In-Reply-To
<gcvg.1203111617.379@landroval.ancalagon.de>
Hello Thomas,
On Sun, Mar 11, 2012 at 16:17, Thomas Hochstein <thh@inter.net> wrote:
Show 39 quoted lines
> Junio C Hamano wrote:
>
>> suvayu ali <fatkasuvayu+linux@gmail.com> writes:
>>
>>> ... is that discussion on progit talking about
>>> something else?
>>
>> Sorry, I do not read or write progit, so I do not know offhand what
>> it says in the section you read and I cannot judge if it was you who
>> misread, or if it was book that misspoke.
>
> The book says:
>> You can also use Git attributes to tell Git to use different merge
>> strategies for specific files in your project. One very useful option
>> is to tell Git to not try to merge specific files when they have
>> conflicts, but rather to use your side of the merge over someone
>> else’s.
>>
>> This is helpful if a branch in your project has diverged or is
>> specialized, but you want to be able to merge changes back in from
>> it, and you want to ignore certain files. Say you have a database
>> settings file called database.xml that is different in two branches,
>> and you want to merge in your other branch without messing up the
>> database file. You can set up an attribute like this:
>>
>>| database.xml merge=ours
>>
>> If you merge in the other branch, instead of having merge conflicts
>> with the database.xml file, you see something like this:
>>
>>| $ git merge topic
>>| Auto-merging database.xml
>>| Merge made by recursive.
>>
>> In this case, database.xml stays at whatever version you originally had.
>
> That seems to be incorrect, as far as I understand the gitattributes
> man page.
>

Thank you for confirming the error. I have opened a ticket on the progit repo on github. If you are interested, you can follow it on the page linked below.

<https://github.com/progit/progit.github.com/issues/5>
Cheers,
-- 
Suvayu

Open source is the future. It sets us free.
Previous: Thomas Hochstein
Message 7 of 7 in “Trouble with file specific merge strategies”
  1. suvayu aliMar 10, 2012
  2. Junio C HamanoMar 11, 2012
  3. suvayu aliMar 11, 2012
  4. Junio C HamanoMar 11, 2012
  5. suvayu aliMar 11, 2012
  6. Thomas HochsteinMar 11, 2012
  7. suvayu aliMar 11, 2012

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.