def copy_git_src(src, dest):
    """
    Copy a source to a destination but only copy the files under version control.
    Assumes that ``src`` is inside a git worktree
    """
    process = subprocess.Popen(["git", "ls-files", "."], cwd=src,
                               stdout=subprocess.PIPE)
    (out, _) = process.communicate()
    for filename in out.splitlines():
        src_file = os.path.join(src, filename.decode('ascii'))
        dest_file = os.path.join(dest, filename.decode('ascii'))
        install(src_file, dest_file, quiet=True)