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

symlinked working tree gotcha

From
Joey Hess <joey@kitenet.net>
Date
Apr 24, 2011, 16:58 UTC
Message-ID
<20110424165825.GA21062@gnu.kitenet.net>

joey@gnu:/tmp>mkdir foo joey@gnu:/tmp>cd foo joey@gnu:/tmp/foo>git init Initialized empty Git repository in /tmp/foo/.git/ joey@gnu:/tmp/foo>touch foo joey@gnu:/tmp/foo>git add /tmp/foo/foo joey@gnu:/tmp/foo>cd .. joey@gnu:/tmp>ln -s foo bar joey@gnu:/tmp>cd bar joey@gnu:/tmp/bar>touch bar joey@gnu:/tmp/bar>git add /tmp/bar/bar fatal: '/tmp/bar/bar' is outside repository

Is this a bug or a feature of git? I had some code where I had, lazily, assumed that passing the full path to the file would always work, since it did, in my experience.

-- 
see shy jo
Next: Junio C Hamano
Message 1 of 4 in “symlinked working tree gotcha”
  1. Joey HessApr 24, 2011
  2. Junio C HamanoApr 25, 2011
  3. Joey HessApr 25, 2011
  4. Jay SoffianApr 26, 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.