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

Re: git-add fails after file type change

From
Junio C Hamano <junkio@cox.net>
Date
Dec 16, 2006, 19:23 UTC
Message-ID
<7vmz5nejav.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<458437E0.1050501@midwinter.com>
Steven Grimm <koreth@midwinter.com> writes:
Show 10 quoted lines
> $ mkdir dir
> $ echo foo > dir/file
> $ git add .
> ...
> Committing initial tree f4bc9c50d08b041f5e096fa68e243c34170f1cd8
> create mode 100644 dir/file
> $ mv dir dir.real
> $ ln -s dir.real dir
> $ git add .
> fatal: unable to add dir to index

You didn't tell the index to remove dir/file. You cannot have dir and dir/file at the same time.

Previous: Junio C Hamano
Message 11 of 11 in “git-add fails after file type change”
  1. Steven GrimmDec 16, 2006
  2. Jakub NarebskiDec 16, 2006
  3. Steven GrimmDec 16, 2006
  4. A Large Angry SCMDec 16, 2006
  5. Junio C HamanoDec 16, 2006
  6. Steven GrimmDec 16, 2006
  7. Steven GrimmDec 17, 2006
  8. Junio C HamanoDec 17, 2006
  9. Junio C HamanoDec 17, 2006
  10. git-add: remove conflicting entry when adding.Junio C Hamano, Dec 17, 2006
  11. Junio C HamanoDec 16, 2006

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.