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

Cannot clone a linked working directory.

From
Bjørnar Snoksrud <snoksrud@gmail.com>
Date
Jun 24, 2015, 10:38 UTC
Message-ID
<CA+cck7FB6QPz1Pec11TPXxxAhwKR78K9swgsQjMrZPhKJzi_iw@mail.gmail.com>

Summary: When creating a linked working directory with `git checkout --to`, you cannot clone from the local path. This works when cloning the main repository directory.

I couldn't find anything the the documentation for `git checkout` that indicates that this shouldn't work.

Repro: Creating a repo `foo`, checkout --to'ing it to ../bar, then try to clone both resulting repositories -

$ git --version git version 2.4.4.600.g6397abd $ mkdir foo $ cd foo $ git init Initialized empty Git repository in /bar/foo/.git/ $ git commit -m init --allow-empty [master (root-commit) c6da399] init $ git branch bar $ git checkout bar --to ../bar Enter ../bar (identifier bar) Switched to branch 'bar' $ cd ../bar $ cd bar $ git status -sb ## bar $ cd .. $ git clone bar baz Cloning into 'baz'... fatal: '/path/bar' does not appear to be a git repository fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists. $ git clone foo baz Cloning into 'baz'... done.

-- 
bjornar@snoksrud.no
Next: Duy Nguyen
Message 1 of 2 in “Cannot clone a linked working directory.”
  1. Bjørnar SnoksrudJun 24, 2015
  2. Duy NguyenJun 24, 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.