I'm setting up a script that downloads application source code from remote git repository and then launches the application build process. For obvious reasons I only need the current state (revision) of codebase to be downloaded - no need for history. Is there a way in git to achieve that? Cloning the whole repository is too painful.
You can use git clone --depth 1 ...
(see FAQ: How do I do a quick clone without history revisions?)
You may try the --depth=1
parameter of git checkout:
git clone --depth=1 git://somehost/somerepo.git
alternatively, if your remote host support, you can use git archive
:
git archive --format=tar --remote=git://somehost/somerepo.git master | tar -xf -
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With