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

Re: 'git diff' against files outside a git repo

From
Avery Pennarun <apenwarr@gmail.com>
Date
Sep 26, 2010, 09:38 UTC
Message-ID
<AANLkTikJ-SN5xmwqhEHcESfQCWvGjSHp3OK1Hi4+0jBL@mail.gmail.com>
In-Reply-To
<7vwrq9m0y0.fsf@alter.siamese.dyndns.org>
On Sun, Sep 26, 2010 at 12:13 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> Avery Pennarun <apenwarr@gmail.com> writes:
>
>> Oddly, 'git diff file1 file2' *doesn't* work when file1 and file2 are
>> in a working tree; git tries to diff something, apparently, but I
>> don't know what.
>
> Heh, I thought you've been using git long enough that you sh/would know
> that you are comparing the index and the working tree, using "file1" and
> "file2" as pathspecs.

Ha, of course. And I do that all the time, so it's silly that I somehow forgot for the duration of that email.

The real surprise was that this *wasn't* the meaning when I was outside a git tree :)

Have fun,
Avery
Previous: Junio C HamanoNext: Michael J Gruber
Message 5 of 7 in “'git diff' against files outside a git repo”
  1. Avery PennarunSep 24, 2010
  2. Elijah NewrenSep 24, 2010
  3. Avery PennarunSep 25, 2010
  4. Junio C HamanoSep 26, 2010
  5. Avery PennarunSep 26, 2010
  6. Michael J GruberSep 27, 2010
  7. Brandon CaseySep 24, 2010

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.