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

Re: list of files that have been added/removed

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 15, 2009, 21:43 UTC
Message-ID
<7vvdp5r3s5.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<31043.1239831470@relay.known.net>
layer <layer@known.net> writes:
Show 5 quoted lines
>   I see the changes in the index with "git status" as "deleted" or
>   "added".  
>
> I meant "new file" here.  Of course I can process the output of "git
> status", but I was looking for a cleaner method, if there is one.
"Process" as in "Read in a script and have it act on the information"?
git diff-index --name-status HEAD

would be one Kosher way for the scripts, and if your scripting language can handle NUL terminated string, giving -z option would make your script more robust against funny pathnames.

git diff-index --name-only --diff-filter=A HEAD
if you only care about "new file" and nothing else.
Previous: Eric RaibleNext: layer
Message 3 of 4 in “Re: list of files that have been added/removed”
  1. layerApr 15, 2009
  2. Eric RaibleApr 15, 2009
  3. Junio C HamanoApr 15, 2009
  4. layerApr 15, 2009

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.