]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/clone.c
clone: --dissociate option to mark that reference is only temporary
authorJunio C Hamano <gitster@pobox.com>
Tue, 14 Oct 2014 19:38:52 +0000 (12:38 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Oct 2014 21:34:45 +0000 (14:34 -0700)
commitfb1d6dabce69bce3f28a7f442da990ef8df872ac
treee4b2b407ad99e4f8fafd38f0465cf93b5a943fbb
parent3c2dc76f015b4d52ef02a08c59a4546d00b475e1
clone: --dissociate option to mark that reference is only temporary

While use of the --reference option to borrow objects from an
existing local repository of the same project is an effective way to
reduce traffic when cloning a project over the network, it makes the
resulting "borrowing" repository dependent on the "borrowed"
repository.  After running

git clone --reference=P $URL Q

the resulting repository Q will be broken if the borrowed repository
P disappears.

The way to allow the borrowed repository to be removed is to repack
the borrowing repository (i.e. run "git repack -a -d" in Q); while
power users may know it very well, it is not easily discoverable.

Teach a new "--dissociate" option to "git clone" to run this
repacking for the user.

Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-clone.txt
builtin/clone.c
t/t5700-clone-reference.sh