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

Re: A little help with error?

From
Jeff King <peff@peff.net>
Date
Aug 10, 2011, 12:21 UTC
Message-ID
<20110810122121.GB17071@sigill.intra.peff.net>
In-Reply-To
<752985D1B23046F994920F9018B53DF8@rustydogink.com>
On Sun, Aug 07, 2011 at 02:16:57PM -0700, Rusty Dog Ink wrote:
> git add --force /Users/chris/Sites/mattSchubert/public/css/browserfix.css => "Crappy Error"
> Yields this error.
> fatal: '/Users/chris/Sites/mattSchubert/public/css/browserfix.css' is outside repository 

We can't say if this is reasonable or not without knowing more. Which directory are you in? Which git repository do you expect to be found? Which repository does git actually find (try "git rev-parse --git-dir")? Do you have GIT_WORK_TREE set in the environment, or core.worktree set in your config?

> This command does gives the same error. 
> git add --force /public/css/browserfix.css => "Same error"
> But this command, works. Why?
> git add --force public/css/browserfix.css => "Works yeah"
The top one seems nonsensical, unless your git repository is at one of:
  /.git
  /public/.git
  /public/css/.git

The bottom one makes sense; you are looking at files in the current directory, which is going to be inside your repository (unless you are setting some of worktree variables I mentioned above).

Are you trying to do something clever with symlinks to /public? If so, show us.

-Peff
Previous: Rusty Dog Ink
Message 2 of 2 in “A little help with error?”
  1. Rusty Dog InkAug 7, 2011
  2. Jeff KingAug 10, 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.