After doing a "make mrproper" in my Linux git tree, the result is still 1.1GB
of files. Compare that with just the tarball, which is just one-forth the size.Is there a way to "trim away" old commits from the repository, so that it just
doesn't take up that much space? I don't care about any commits made in 2005.
As long as I can still do "git pull" from the source repo to update mine,
that's good enough.--
Timur Tabi
Linux Kernel Developer @ Freescale
-
-------- Original-Nachricht --------
Datum: Wed, 15 Nov 2006 16:11:57 -0600
Von: Timur Tabi <timur@freescale.com>
An: git@vger.kernel.orgIs it possible to do this with shallow clone?
Shallow clone the local repository my.git (which should be trimmed) starting from the last needed commit to a new local repository my_trimmed.git. And then remove my.git (with something like rm -rf my.git) and rename my_trimmed.git to my.git?Thomas
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal f
Maybe. How do you do a shallow clone? I tried "git clone" followed by
"git-repack", and that helped a lot, but the result was still twice the size of
a normal tarball. I don't see any "shallow" option to the clone command, and
git-shallow-pack doesn't exist on my installation.--
Timur Tabi
Linux Kernel Developer @ Freescale
-
Twice the size of a normal tarball isn't too bad, considering that
you have the _complete_ history in the pack and yet the normal
tarball has no history at all.Shallow clone is a development feature still being working on in
Junio's 'pu' branch of git.git. It has a few issues still to be
worked out so it hasn't been made part of one of the more stable
branches yet (like 'next', 'master', or 'maint').--
Shawn.
-
That is true. However, for the particular project I'm working on, double the
size is not really acceptable.My goal is to provide a source tree that is "git enabled", so that user can use
git command to fetch, apply, and create patches. Currently, we're just handingWell, until it's available on an official git release, it doesn't help me.
--
Timur Tabi
Linux Kernel Developer @ Freescale
-
Hi,
Well, if you help it, it will be available on an official git release
soon!Ciao,
Dscho-
One of the reasons its hanging out in 'pu' still is that there is
a lack of people who are interested in the feature, and thus not
enough people are testing it. Perhaps you might be able to lend
a hand in that regard?--
Shawn.
-
Sure, I can do that! Can you give me some pointers? I've never done
development on git itself, so I don't know Junio or his pu (sorry, I couldn't
resist :-)).--
Timur Tabi
Linux Kernel Developer @ Freescale
-
Junio C Hamano is the Git maintainer. His published Git repository
is here:http://www.kernel.org/pub/scm/git/git.git/
though it oddly has pack files from Jun 2006 in the wrong directory.
Weird. Anyway...If you clone from that URL, or better though the native Git protocol:
git://www.kernel.org/pub/scm/git/git.git
you will get a branch called `pu`, which is the set of "Proposed
Updates" to Git that Junio and others are currently working on.
You can then checkout a branch off that, and build it:git checkout -b pu-build pu
makefinally you can either run from that directory (see INSTALL file)
or you can install the binary somewhere else. We don't really
recommend using `pu` for production level work, so make sure you
have a backup of any repository you run it on. :)--
Shawn.
-
So how do I make a shallow clone? I've set it all up, but there is no
git-shallow-clone command, and git help clone doesn't have anything either.--
Timur Tabi
Linux Kernel Developer @ Freescale
-
Hi,
Try "git clone --depth 1 <url>". This will cut each ancestor chain after
one ancestor (IIRC).Ciao,
Dscho-
I think you mean git-clone.sh instead of git-clone. If I do the above command,
I get:$ ./git clone --depth 1 git://127.0.0.1/temp/u-boot-83xx/
Usage: /home/b04825/bin/git-clone [--template=<template_directory>]
[--use-separate-remote] [--reference <reference-repo>] [--bare] [-l [-s]] [-q]
[-u <upload-pack>] [--origin <name>] [-n] <repo> [<dir>]However, git-clone.sh is not quite working either. I had to run git-daemon on
my machine, because git-clone.sh doesn't like the http protocol, and my firewall
blocks everything but that. So I cloned a repo, started git-daemon, and I tried
this:$ ./git-clone.sh --depth 1 git://127.0.0.1/temp/u-boot-83xx
usage: git-fetch-pack [--all] [-q] [-v] [-k] [--thin] [--exec=upload-pack]
[host:]directory <refs>...
fetch-pack from 'git://127.0.0.1/temp/u-boot-83xx/' failed.A regular git-clone of git://127.0.0.1/temp/u-boot-83xx works, so I think
there's something wrong with git-clone.sh or my invocation thereof.--
Timur Tabi
Linux Kernel Developer @ Freescale
-
Hi,
No. If "git clone" does not work for you, the compilation failed. Do you
run git in-place? Then you _have_ to setbindir=$(pwd)
in config.mak. Otherwise, the git wrapper (you wrote "git-clone", but then
you used "git clone") will look in $(HOME)/bin for your executables, and IFor now, shallow clones only work with the git protocol, i.e. via
git-daemon and ssh.Hth,
Dscho
-
When I tried that, make spits out this:
GIT_VERSION = 1.4.4.ge1173-dirty
* new build flags or prefix
(cd perl && /usr/bin/perl Makefile.PL \
PREFIX='/home/b04825')
Writing Makefile for GitSo I tried this:
make configure
./configure --prefix=$PWD
makeand got this:
* new build flags or prefix
(cd perl && /usr/bin/perl Makefile.PL \
PREFIX='/temp/git')
Writing Makefile for Gitwhich is better, but git-clone still doesn't work:
$ ./git clone --depth 1 git://127.0.0.1/temp/u-boot-83xx
Failed to run command 'clone': Success$ ./git-clone --depth 1 git://127.0.0.1/temp/u-boot-83xx
usage: git-fetch-pack [--all] [-q] [-v] [-k] [--thin] [--exec=upload-pack]
[host:]directory <refs>...
fetch-pack from 'git://127.0.0.1/temp/u-boot-83xx' failed.In both of these cases, the git-daemon process doesn't log anything.
I even tried "export GIT_DIR=$PWD", but that didn't do anything.
--
Timur Tabi
Linux Kernel Developer @ Freescale
-
No. However...
Have you tried "git repack -a -d" to repack the loose objects into
a pack file? Doing this every so often should reduce your disk
space consumed by a HUGE amount.--
Shawn.
-
Woah! It shrunk that bad boy down to 420M! That should do it, thanks!
I wonder why the powerpc tree shrank so much. Do you think the maintainer
just needs to run git-repack on his tree?--
Timur Tabi
Linux Kernel Developer @ Freescale
-
Possible, yes.
However published repositories don't tend to repack as often as
it makes things harder for people who clone/fetch over HTTP rather
than the native git protocol.The reason is that HTTP can fetch individual loose objects that
you don't have yet, but if the object is only available in a pack
file then you need to fetch the entire pack file. But you might
already have most of that pack file, so now you are downloading
lots of data you already have. :-(--
Shawn.
-
| Andrew Morton | -mm merge plans for 2.6.23 |
| Chuck Ebbert | Why do so many machines need "noapic"? |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Greg Kroah-Hartman | [PATCH 023/196] MCP_UCB1200: Convert from class_device to device |
git: | |
| David Miller | Re: [BUG] New Kernel Bugs |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 31/37] dccp: Remove manual influence on NDP Count feature |
| Gregory Haskins | [RFC PATCH 00/17] virtual-bus |
