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

Please consider adding a -f switch to git-clone (or something similar)

From
DVDiego Viola <diego.viola@gmail.com>
Date
Mar 7, 2015, 21:54 UTC
Message-ID
<CA+ToGPEZN7TBcYF3o5YgbayjZ8WKok-fjTPeq5nbt2vAG1wDDQ@mail.gmail.com>
Hello,

I was thinking about creating a new repository in my home dir so that I could keep my dot files in it.

However, I found that I can't do a `git clone url:user/repo.git .` in a non-empty directory.

Is there a possibility of implementing a -f switch to git-clone so that when I use that, git would still clone the repo in the non-empty directory and keep the untracked files untracked/unstaged? (just as if I copied files to the git repo).

I know I could git-init in a empty directory and then copy the .git dir to the non-empty directory as a workaround, but I like the idea of cloning better.

My C skills aren't that great or I would have sent a patch already.
Thanks,
Diego
Next: Andreas Schwab
Message 1 of 7 in “Please consider adding a -f switch to git-clone (or something similar)”
  1. Diego ViolaMar 7, 2015
  2. Andreas SchwabMar 7, 2015
  3. brian m. carlsonMar 7, 2015
  4. Diego ViolaMar 8, 2015
  5. Diego ViolaMar 8, 2015
  6. Kyle J. McKayMar 8, 2015
  7. Diego ViolaMar 8, 2015

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.