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

Re: How do I force git to forget about merging a binary file that is to stay deleted on the target branch?

From
Brent Goodrick <bgoodr@gmail.com>
Date
Mar 28, 2009, 15:21 UTC
Message-ID
<e38bce640903280821k79aa241fqded9fc454e266353@mail.gmail.com>
In-Reply-To
<7viqltvg7n.fsf@gitster.siamese.dyndns.org>
On Sat, Mar 28, 2009 at 8:07 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
>> You can resolve this merge conflict by running
>> $ git rm TimeSheets/Timesheet\ Exempt.XLS
>>
>> which will make git delete the file from your working copy and the
>> index, at which point you can then make a commit that does not include
>> this file.
>
> But is this what you really want to do?  After doing such a "remove it"
> merge resolution at Home, wouldn't merging it back to Work remove the
> file?

Yes, and I've not told the full story. Each time I do a merge in between the two branches, I have a script that resets certain files that I don't want cross-pollinated between the two branches. Then I do the commit. Most of the time (on non-binary files, and/or on files I only change on the work branch and not on the home branch), this works just fine.

My desire to avoid doing the above drove my earlier post asking whether there as a facility to exclude certain files from participating in merges. But the answer was "no" to that, hence my ad hoc workaround above.

bg
Previous: Junio C Hamano
Message 7 of 7 in “How do I force git to forget about merging a binary file that is to stay deleted on the target branch?”
  1. Brent GoodrickMar 28, 2009
  2. Nanako ShiraishiMar 28, 2009
  3. Brent GoodrickMar 28, 2009
  4. Elijah NewrenMar 28, 2009
  5. Brent GoodrickMar 28, 2009
  6. Junio C HamanoMar 28, 2009
  7. Brent GoodrickMar 28, 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.