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

Re: Cloning into an existing directory

From
RSRussell Steicke <russellsteicke@gmail.com>
Date
Feb 16, 2009, 07:31 UTC
Message-ID
<c1b8b6670902152331p9bbdb8fo7bf7048039b5301c@mail.gmail.com>
In-Reply-To
<e38bce640902152310x195a14e5p445817bdfc6e319f@mail.gmail.com>
On 2/16/09, Brent Goodrick <bgoodr@gmail.com> wrote:
Show 13 quoted lines
> Hi,
>
>  I would like to manage my startup scripts such as .bashrc and other
>  setup files relative to my HOME directory using Git. However,
>  git-clone disallows cloning into the existing "." directory, but only
>  allows cloning into a subdirectory that does not yet exist.  If my
>  home directory is /home/brentg and my remote repository is on
>  remote_machine:~brentg/my_setup.git then git clone in my home
>  directory on the local machine creates /home/brentg/my_setup with
>  files such as .bashrc inside it, which is not what I want. I want them
>  checked out and managed _in_ the current working directory, and not to
>  mess with other files or directories that already exist that are never
>  to be managed by git.

cd git init git remote add origin remote_machine:~brentg/my_setup.git git fetch git branch master origin/master git checkout master

You may have to delete .bashrc and others before git will overwrite them on checkout.

-- 
Virus found in this message.
Previous: Brent GoodrickNext: Brent Goodrick
Message 2 of 5 in “Cloning into an existing directory”
  1. Brent GoodrickFeb 16, 2009
  2. Russell SteickeFeb 16, 2009
  3. Brent GoodrickFeb 16, 2009
  4. Andrew RuderFeb 16, 2009
  5. Brent GoodrickFeb 17, 2009

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.