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

Re: Cloning into an existing, non-empty directory?

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 23, 2011, 10:15 UTC
Message-ID
<20110423101500.GB1500@elie>
In-Reply-To
<BANLkTikY7c7rP+yv5vt2vxw5nu84k_H=Xw@mail.gmail.com>
Hi again,
Richard Hartmann wrote[1]:
> 1) git merge does not seem to understand either of those parameters.

I assume you mean --work-tree and --git-dir. But if true, that would be a bug.

Based on the script, it looks like you are not passing a branch name to "git merge". Maybe that is the problem. In any case, it would be nice to see what command you used, what result was expected, and what result actually occured.

Side note: git commands respect the GIT_DIR and GIT_WORK_TREE environment variables in addition to the corresponding command-line parameters, which can save some typing.

[...]
Show 6 quoted lines
> 2) running `git pull` as suggested results in:
>
> fatal: /usr/lib/git-core/git-pull cannot be used without a working tree.
>
> which can be worked around by using --work-tree and --git-dir . Not
> ideal, but workeable if I accept the race condition.

Weird. Maybe chdir-ing into the work tree will help? (Traditionally, git commands tend to be run from within the work tree, so I wouldn't be too surprised if some commands do not like being run from outside.)

[1] http://thread.gmane.org/gmane.comp.version-control.git/171920/focus=171934
Previous: Richard HartmannNext: Nguyen Thai Ngoc Duy
Message 4 of 12 in “Cloning into an existing, non-empty directory?”
  1. Richard HartmannApr 21, 2011
  2. Jonathan NiederApr 21, 2011
  3. Richard HartmannApr 22, 2011
  4. Jonathan NiederApr 23, 2011
  5. Nguyen Thai Ngoc DuyApr 23, 2011
  6. Jonathan NiederApr 23, 2011
  7. Richard HartmannApr 23, 2011
  8. Jonathan NiederApr 25, 2011
  9. Andreas SchwabApr 25, 2011
  10. Jonathan NiederApr 25, 2011
  11. Jeff KingApr 25, 2011
  12. Richard HartmannApr 25, 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.