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

Re: Copieing git repository to another disk is dangerous ! Especially in combination with remotes set to local repositories !

From
KKKonstantin Khomoutov <kostix@bswap.ru>
Date
Dec 4, 2025, 09:04 UTC
Message-ID
<fgjktagigkapjtmx5mxxzkoll5krt6fvdhcsjhed6esalhabp3@famahk7xyaah>
In-Reply-To
<AM0PR02MB44508B247E4B6EF4F387DA5FB3A6A@AM0PR02MB4450.eurprd02.prod.outlook.com>
On Thu, Dec 04, 2025 at 03:59:19AM +0000, Skybuck Flying wrote:
[...]
Show 8 quoted lines
> X:
> cd X:\Vite\Repository\Mirror
> git clone --mirror https://github.com/vitelabs/go-vite .
> 
> cd X:\Vite\Branch\Develop\Delphi
> git clone -o Repository "X:\Vite\Repository\Mirror" .
> 
> Now copy the contents of this disk to a new disk... (virtual disks)
Show 5 quoted lines
> git remote -v will show:
> 
> X:\Vite\Repository\Mirror
> 
> In other words the remote is still pointing to the mirror on disk X !!!!
I do not understand the problem: the command
  git clone -o Repository "X:\Vite\Repository\Mirror"
  
has cloned the repository "X:\Vite\Repository\Mirror", and so it is completely
expected that re so-called "remote" to which you gave the name "Repository"
records the URL of the remote repository it points at exactly as it has been
provided by the user - with the drive letter in this case.

If you do not want this behavior, you might consider using UNC paths or a reasonably recent (2010s, I think) addition to NTFS called "junction points" which allows you to mount an external drive "on" an empty filesysem folder - almost UNIX-way, so to speak ;-) See the "mountvol" console command and [1].

 1. https://serverfault.com/a/8871
Previous: Torsten Bögershausen
Message 3 of 3 in “Copieing git repository to another disk is dangerous ! Especially in combination with remotes set to local repositories !”
  1. Skybuck FlyingDec 4, 2025
  2. Torsten BögershausenDec 4, 2025
  3. Konstantin KhomoutovDec 4, 2025

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.