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

executing git from a non git directory

From
Patrick Aljord <patcito@gmail.com>
Date
Jul 22, 2007, 06:55 UTC
Message-ID
<6b6419750707212355q48a934e4n3be0d6111694ad01@mail.gmail.com>
Hey all,
I have my git directory that is in /path/to/my_git_dir
I would like to check it from another direcory, I tried the following command:
$ git --git-dir=/path/to/my_git_dir status
and
$ GIT_DIR='/path/to/my_git_dir' && git status

but in both cases I get this error: fatal: Not a git repository: '/path/to/my_git_dir'

yet when I do "$ cd /path/to/my_git_dir && git status" I do get the results.

Any idea what I'm doing wrong or if there's a way to check a git dir from a non git dir?

thanx in advance
Pat
Next: Shawn O. Pearce
Message 1 of 4 in “executing git from a non git directory”
  1. Patrick AljordJul 22, 2007
  2. Shawn O. PearceJul 22, 2007
  3. Jeff KingJul 22, 2007
  4. Patrick AljordJul 22, 2007

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.