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

[bug?] checkout -m doesn't work without a base version

From
PHPete Harlan <pgit@pcharlan.com>
Date
Dec 4, 2011, 22:31 UTC
Message-ID
<4EDBF4D5.6030908@pcharlan.com>
Hi,

If during a merge I've resolved conflicts in foo.c but want to start over with foo.c to resolve them differently, I can say "git checkout -m foo.c" to restore it to its un-resolved state.

But this only works if there's a base version; if foo.c was added in each branch, we get:

   error: path 'foo.c' does not have all three versions

Git didn't need all three versions to create the original conflicted file, so why would it need them to recreate it?

(The message is the same if I explicitly tell Git I don't want diff3 via "git checkout --conflict=merge foo.c".)

If this is considered a bug worth fixing I'll write a test that it fails; if it's expected behavior I think the docs should mention that.

Thanks,

Pete Harlan pgit@pcharlan.com

Next: Junio C Hamano
Message 1 of 15 in “[bug?] checkout -m doesn't work without a base version”
  1. Pete HarlanDec 4, 2011
  2. Junio C HamanoDec 5, 2011
  3. Pete HarlanDec 7, 2011
  4. Junio C HamanoDec 8, 2011
  5. Pete HarlanDec 12, 2011
  6. Junio C HamanoDec 12, 2011
  7. t/t2023-checkout-m.sh: fix use of test_must_failÆvar Arnfjörð Bjarmason, Dec 20, 2011
  8. Junio C HamanoDec 20, 2011
  9. Michael SchubertDec 14, 2011
  10. Junio C HamanoDec 14, 2011
  11. Miles BaderDec 15, 2011
  12. Michael SchubertDec 15, 2011
  13. Andreas SchwabDec 15, 2011
  14. Junio C HamanoDec 15, 2011
  15. Ramsay JonesDec 16, 2011

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.