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

Re: Rerunning merge on a single file

From
SBSanti Béjar <santi@agolina.net>
Date
Oct 14, 2008, 12:28 UTC
Message-ID
<adf1fd3d0810140528p8bf8958t528b226d01a55a45@mail.gmail.com>
In-Reply-To
<adf1fd3d0810140521g7f43ee3bs5d4e60772bcc1d8c@mail.gmail.com>
On Tue, Oct 14, 2008 at 2:21 PM, Santi Béjar <santi@agolina.net> wrote:
Show 19 quoted lines
> On Tue, Oct 14, 2008 at 2:13 PM, Kristian Amlie
> <kristian.amlie@trolltech.com> wrote:
>> Hey, I have question about advanced merging.
>>
>> Suppose I have a huge merge with conflicts all over the place. There is no
>> way to avoid them, so I start working from the top. At some point, however,
>> I make a mistake and lose the merge information for one file (for example by
>> checking out the file from HEAD).
>>
>> In that case I would like to get the conflict markers back, and do that file
>> over again, but I don't want to throw away the rest of the index state.
>> Currently the only way I can see to do this is by checking out several file
>> versions under different names and then using git merge-file on them.
>>
>> Is there a better way to achieve this?
>
> If the different versions are still in the index you could use:
>
> $ git checkout --merge $file

Note that this is very new, as it was introduced in v1.6.0.1-26-geac5a40, so you'll need at least 1.6.0.2.

Santi
Previous: Santi BéjarNext: Kristian Amlie
Message 3 of 4 in “Rerunning merge on a single file”
  1. Kristian AmlieOct 14, 2008
  2. Santi BéjarOct 14, 2008
  3. Santi BéjarOct 14, 2008
  4. Kristian AmlieOct 14, 2008

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.