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

Easiest way to clone over an existing directory?

From
Josh Triplett <josh@joshtriplett.org>
Date
Jun 15, 2016, 15:51 UTC
Message-ID
<20160615155133.GA13168@x>
Currently, every time I set up a new system, I run the following:

git clone $MY_HOMEDIR mv home/.git . rm -r home git checkout -f

This seems like an odd dance to go through. But I can't just git clone into ~ directly, because git clone will not clone into an existing non-empty directory.

(I could use "git clone -n" to avoid the unnecessary checkout, but the files are small, and it wouldn't remove the need to rmdir so the number of commands would remain the same.)

Does some better way exist to handle this? And if not, would it make sense for git clone to have an option to clone into an existing directory (which should also avoid setting junk_work_tree)?

Next: brian m. carlson
Message 1 of 2 in “Easiest way to clone over an existing directory?”
  1. Josh TriplettJun 15, 2016
  2. brian m. carlsonJun 16, 2016

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.