threads / discuss / 13791

list all the untrack files in a git respo

Subject: list all the untrack files in a git respo

## tl;dr

5 messages between Jun 4, 2008 and Jun 4, 2008.

replies: 4people: 4as markdown or json

Gerb Stralko· Jun 4, 2008, 14:05 UTC · lore

Is there a way to list only the untracked files in git? git status works, but i need to do some parsing in order to get a list of untracked files. Something like git status --show-only-untracked?

thanks
Jerry
Jakub Narebski· Jun 4, 2008, 14:19 UTC · re: Gerb Stralko · lore

Re: list all the untrack files in a git respo

"Gerb Stralko" <gerb.stralko@gmail.com> writes:
> Is there a way to list only the untracked files in git? git status
> works, but i need to do some parsing in order to get a list of
> untracked files.  Something like git status --show-only-untracked?

git-status is porcelain, meant for human consumption. For list of untracked files use

  $ git ls-files --other --exclude-standard
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Johan Herland· Jun 4, 2008, 14:20 UTC · re: Gerb Stralko · lore

Re: list all the untrack files in a git respo

On Wednesday 04 June 2008, Gerb Stralko wrote:
> Is there a way to list only the untracked files in git? git status
> works, but i need to do some parsing in order to get a list of
> untracked files.  Something like git status --show-only-untracked?
Is
	git ls-files -o
what you want?

(Depending on your use case, you might also find the --exclude-standard and --directory options useful as well. See the git-ls-files manual page for details)

...Johan
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Michael J Gruber· Jun 4, 2008, 15:55 UTC · re: Gerb Stralko · lore

Re: list all the untrack files in a git respo

Gerb Stralko venit, vidit, dixit 04.06.2008 16:05:
Show 7 quoted lines
> Is there a way to list only the untracked files in git? git status
> works, but i need to do some parsing in order to get a list of
> untracked files.  Something like git status --show-only-untracked?
> 
> thanks
> 
> Jerry
git-ls-files --others --exclude-standard
may be what you are looking for.
Michael

← back to recent threads