Skip to content

git post-receive template should use archive, not clone #367

@jyaworski

Description

@jyaworski

Currently, the post-receive template uses git clone to populate environments. Using git archive would greatly reduce the space used, as it's close to svn export. Using my checkout of this repo:

joseph.yaworski@jyaworski-mbpr ~/github/puppet-puppet (git)-[master] % du -hs .
8.8M    .
joseph.yaworski@jyaworski-mbpr ~/github/puppet-puppet (git)-[master] % git archive --format tar --prefix export/ HEAD | tar -x
joseph.yaworski@jyaworski-mbpr ~/github/puppet-puppet (git)-[master] % du -sh export 
464K    export

Are there concerns using archive rather than clone?

Edit:
To check out a specific branch to a specific dir:

git archive --format tar --prefix branchname/ branchname: | tar -x -C /etc/puppet/environments

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions