Skip to content

Consider reinit git #9

@iopapamanoglou

Description

@iopapamanoglou

@mawildoer wrote this (untested)
Not sure whether we want clearing the git history though

    # Remove/re-init .git dir ----------------------------------------
    try:
        if (root / ".git").exists():
            console.print("Removing .git directory")
            if not dry_run:
                subprocess.run(
                    ["rm", "-rf", ".git"],
                    cwd=root,
                    check=True,
                    stdout=subprocess.PIPE,
                    stderr=subprocess.PIPE,
                )
    except subprocess.CalledProcessError as e:
        console.print(f"[red]Error removing .git dir:[/red] {e}")
    else:
        if not dry_run:
            subprocess.run(
                ["git", "init"],
                cwd=root,
                check=False,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE,
            )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions