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

renaming a file into a directory causes a pull error on older repos

From
Greg KH <greg@kroah.com>
Date
Mar 16, 2008, 04:31 UTC
Message-ID
<20080316043138.GA7942@kroah.com>

So I had heard from someone else that this was a problem with git, but brushed it off as something that no one "normal" would ever run into. Well, I did tonight.

The problem:
  If you turn a file in a repository into a directory, and place files
  in that dir and commit it, any other person who had that repo cloned
  somewhere else will get an error when they try to pull and update
  their version.
The error for me is:
	fatal: Entry 'stats/results-18-22.txt' would be overwritten by merge. Cannot merge.
	Merge with strategy recursive failed.
I had turned the file "stats" into a directory.

So, any thoughts as to how to solve this for real? It's trivial to just blow away this repo and clone it again, which will solve the issue for now, but it seems like this might be good to get fixed...

thanks,
greg k-h
Next: Junio C Hamano
Message 1 of 5 in “renaming a file into a directory causes a pull error on older repos”
  1. Greg KHMar 16, 2008
  2. Junio C HamanoMar 18, 2008
  3. git-merge-one-file: fix longstanding stupid thinkoJunio C Hamano, Mar 18, 2008
  4. Greg KHMar 19, 2008
  5. Junio C HamanoMar 19, 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.