Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get just the head from gitosis?

Tags:

git

I have gitosis running on my server. My build system needs to get a copy of the code from gitosis. Right now I clone the whole repository, which takes a long time.

How do I get just the head of a branch? (I've tried git archive, but can't seem to get an archive from gitosis.)

Can I create an archive from a bare repository?

like image 306
ablerman Avatar asked Aug 05 '10 19:08

ablerman


2 Answers

Pass the --depth=1 flag to git clone to only get the HEAD commit. This creates a "shallow clone". Note that there are limitations with a shallow clone: you can't get the full history (obviously), you cannot clone or pull from it, and you cannot push from it.

like image 115
mipadi Avatar answered Oct 22 '22 05:10

mipadi


gitosis does not yet support git-archive, AFAIS. The corresponding branch at http://eagain.net/gitweb/?p=gitosis.git;a=commitdiff;h=refs/heads/remote-archive has not been merged.

So you can't use "git archive --remote=git://git.example.com/repo.git ..." with gitosis yet.

like image 2
thh Avatar answered Oct 22 '22 05:10

thh