Skip to contentSkip to conversation

git-clone and unreliable links?

DISCUSSION Josef Wolf 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore

Josef Wolf

author
#0 lore raw

Hello,

When using git-clone over an unreliable link (say, UMTS) and the network goes down, git-clone deletes everything what was downloaded. When the network goes up again and you restart git-clone, it has to start over from the beginning. Then, eventually, the network goes down again, and everything is deleted again.

Is there a way to omit the deleting step, so the second invocation would start where the first invocation was interrupted?

#1 lore raw
Quoted 8 lines · Josef Wolf

When using git-clone over an unreliable link (say, UMTS) and the network goes down, git-clone deletes everything what was downloaded. When the network goes up again and you restart git-clone, it has to start over from the beginning. Then, eventually, the network goes down again, and everything is deleted again.

Is there a way to omit the deleting step, so the second invocation would start where the first invocation was interrupted?

No, because a clone is not resumable.

The best way to obtain a repository over an unstable link is to ask the repository owner to make a bundle file with git bundle create --heads --tags and serve the file using standard HTTP or rsync, which are resumable protocols. After you download the file, you can clone or fetch from the bundle to initialize your local repository, and then run git fetch to incrementally update to anything that is more recent than the bundle's creation.

#2 lore raw
Quoted 12 lines · Shawn Pearce
Quoted 8 lines · Josef Wolf

When using git-clone over an unreliable link (say, UMTS) and the network goes down, git-clone deletes everything what was downloaded. When the network goes up again and you restart git-clone, it has to start over from the beginning. Then, eventually, the network goes down again, and everything is deleted again.

Is there a way to omit the deleting step, so the second invocation would start where the first invocation was interrupted?

No, because a clone is not resumable.

Quoted 7 lines

The best way to obtain a repository over an unstable link is to ask the repository owner to make a bundle file with git bundle create --heads --tags and serve the file using standard HTTP or rsync, which are resumable protocols. After you download the file, you can clone or fetch from the bundle to initialize your local repository, and then run git fetch to incrementally update to anything that is more recent than the bundle's creation.

If the server is running gitolite, the admin can set it up so that a bundle file is automatically created as needed (including "don't do it more than once per <duration>" logic), and serve it up over rsync using the same ssh credentials as for access to the repo itself.

However, this is not particularly useful for systems with git://,
although it could certainly be *adapted* for http access.

[Documentation is inline, in src/commands/rsync, for people who wish to know.]

Signature · 1 line
Sitaram