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

Re: fastest way to check if dir is a workdir

From
Jeff King <peff@peff.net>
Date
Aug 12, 2008, 13:01 UTC
Message-ID
<20080812130128.GA28658@sigill.intra.peff.net>
In-Reply-To
<200808121334.57066.thomas@koch.ro>
On Tue, Aug 12, 2008 at 01:34:56PM +0200, Thomas Koch wrote:
Show 6 quoted lines
> I'm writing a little php-git-wrapper and would like to have a function
> which tells me, whether a given path is part of a git checkout or not.
> 
> What would be the fastest commandline to check, whether the current dir
> is part of a checkout? It may be assumed that the repository is at the
> standard position.
How about "git rev-parse --is-inside-work-tree"?
-Peff
Previous: Thomas Koch
Message 2 of 2 in “fastest way to check if dir is a workdir”
  1. Thomas KochAug 12, 2008
  2. Jeff KingAug 12, 2008

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.