{"thread":{"id":"28752","subject":"git gui: adding bare remotes on local filesystem reports error","startedAt":"2011-10-23T16:14:59Z","lastAt":"2011-10-23T16:14:59Z","messageCount":1,"participants":["Peter Oberndorfer"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"178204","messageId":"2536790.zI3kRoQihV@soybean","threadId":"28752","inReplyTo":null,"subject":"git gui: adding bare remotes on local filesystem reports error","fromName":"Peter Oberndorfer","fromEmail":"kumbayo84@arcor.de","sentAt":"2011-10-23T16:14:59Z","receivedAt":"2011-10-23T16:14:59Z","isPatch":false,"sender":{"key":"kumbayo84@arcor.de","avatar":"https://avatars.githubusercontent.com/u/1041267?v=4"},"body":"Hi,\n\ni just tried using git gui to add a remote on the local file system\nand push to it.\n(set Location to /tmp/blah.git, select \"Initialize Remote Repository and Push\")\n\nbut git gui reported:\nfatal: GIT_WORK_TREE (or --work-tree=<directory>) not allowed without specifying GIT_DIR (or --git-dir=<directory>)\n\nI bisected the error to\na9fa11fe5bd5978bb175b3b5663f6477a345d428 git-gui: set GIT_DIR and GIT_WORK_TREE after setup\n\nI guess it is necessary to unset the GIT_DIR and GIT_WORKTREE env vars before calling\ngit --git-dir=$location init --bare\n\nOn a side note i am wondering why it is necessary to call mkdir -p?\nAnd why it is not using git init --bare <path>\nDuring some tests it created all leading directories.\n\nThanks,\nGreetings Peter\n"}]}