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

git gui: adding bare remotes on local filesystem reports error

From
Peter Oberndorfer <kumbayo84@arcor.de>
Date
Oct 23, 2011, 16:14 UTC
Message-ID
<2536790.zI3kRoQihV@soybean>
Hi,

i just tried using git gui to add a remote on the local file system and push to it. (set Location to /tmp/blah.git, select "Initialize Remote Repository and Push")

but git gui reported: fatal: GIT_WORK_TREE (or --work-tree=<directory>) not allowed without specifying GIT_DIR (or --git-dir=<directory>)

I bisected the error to a9fa11fe5bd5978bb175b3b5663f6477a345d428 git-gui: set GIT_DIR and GIT_WORK_TREE after setup

I guess it is necessary to unset the GIT_DIR and GIT_WORKTREE env vars before calling git --git-dir=$location init --bare

On a side note i am wondering why it is necessary to call mkdir -p? And why it is not using git init --bare <path> During some tests it created all leading directories.

Thanks, Greetings Peter

Message 1 of 1 in “git gui: adding bare remotes on local filesystem reports error”
  1. Peter OberndorferOct 23, 2011

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.