Thread (3 messages) flat view 3 messages, 3 authors, 2025-12-04

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

From: Konstantin Khomoutov <hidden>
Date: 2025-12-04 09:20:11

On Thu, Dec 04, 2025 at 03:59:19AM +0000, Skybuck Flying wrote:

[...]
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)
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help