datalad_core.create.create_repo

datalad_core.create.create_repo(directory: Path, *, bare: bool = False, branch: str | None = None, quiet: bool = False) Repo | Worktree[source]

Create a repository in a new or empty directory

This is a thin frontend for the git-init command for creating a new repository in directory. All parameters correspond exactly to the git-clone CLI arguments. If the target directory does not yet exist, it will be created.

Depending on the bare parameter, a Repo or Worktree instance is returned.

Return type:

Repo | Worktree