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

Is git-checkout's restoring d/f conflict really sane?

From
Duy Nguyen <pclouds@gmail.com>
Date
May 14, 2019, 09:41 UTC
Message-ID
<CACsJy8Bew3i6AL_XWfhLhCvdSFYVCGoEQepi9KLmSDPVmDu5Zg@mail.gmail.com>

$ echo data > one $ git add one $ rm one $ mkdir one $ echo two > one/two $ echo three > one/three $ git checkout one $ ls -l one -rw-r--r-- 1 pclouds pclouds 5 May 14 16:36 one

Replacing a file is one thing. In this case we're deleting a directory and unknown number of files inside (in this case 'two' and 'three'). Is this really a good thing to do?

If it's not but too late to do anything about git-checkout, could git-restore do something better (and exactly what)?

-- 
Duy
Next: Junio C Hamano
Message 1 of 4 in “Is git-checkout's restoring d/f conflict really sane?”
  1. Duy NguyenMay 14, 2019
  2. Junio C HamanoMay 14, 2019
  3. Duy NguyenMay 14, 2019
  4. Junio C HamanoMay 15, 2019

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.