From: Jeff King Date: Wed, 18 Feb 2015 22:30:13 GMT Subject: Re: Get a git diff without taking index into account Message-ID: <20150218223013.GA16287@peff.net> In-Reply-To: On Wed, Feb 18, 2015 at 04:38:55PM -0500, Eric Frederich wrote: > Also, how would I go about detecting untracked files the way status does? > There is no way to specify a HEAD per git command using switches or > environment variables. > I can't change the HEAD of the Git repo because other processes may be > using it at the same time. Untracked files are a function of the index, not of the HEAD. So you would load whatever tree you like into your index (either "the" index, or a temporary one you specify with GIT_INDEX_FILE), and then "git ls-files -o". -Peff