def clone(ctx, path_base, repo_url, dir_target):
    """Clones a remote repository.


    .. warning:: Make sure ~/.config is not created beforehand with sudo, otherwise you get:
        unable to access '/home/XXX/.config/git/attributes'

    """
    if 'github' in repo_url:
        ctx.run('ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts', warn
            =True)
        ctx.run('ssh -T git@github.com', warn=True)
    with ctx.cd(path_base):
        ctx.run('git clone -v %s %s' % (repo_url, dir_target))
