@classmethod
def clone(cls, name, vhost, directory, origin):
    """Clone a PaaS instance's vhost into a local git repository."""
    paas_info = cls.info(name)
    if 'php' in paas_info['type'] and not vhost:
        cls.error(
            'PHP instances require indicating the VHOST to clone with --vhost <vhost>'
            )
    paas_access = '%s@%s' % (paas_info['user'], paas_info['git_server'])
    remote_url = 'ssh+git://%s/%s.git' % (paas_access, vhost)
    command = 'git clone %s %s --origin %s' % (remote_url, directory, origin)
    init_git = cls.execute(command)
    if init_git:
        cls.echo(
            'Use `git push %s master` to push your code to the instance.' %
            origin)
        cls.echo('Then `$ gandi deploy` to build and deploy your application.')
