git_init
Initialize a new Git repository in a specified path, creating the directory if missing. Use for fresh projects or non-standard branch/bare layouts; refuses non-empty directories.
Instructions
Initialize a new git repository in repo_path, creating the directory if missing.
Use this when starting a brand-new project, when the working directory is not yet version-controlled, or when a repo needs a non-standard initial branch or bare layout.
Does NOT clone existing projects — use git_clone to fetch a remote repository instead.
Best for: creating a fresh repository before first commit.
Returns: confirmation text with the repository path; refuses non-empty directories, so pass an empty or missing target.
More direct than raw git init because it validates the target directory first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bare | No | Create a bare repository | |
| repo_path | No | Path to initialize the repository in, defaults to '.' (the server working directory) | . |
| initial_branch | No | Name of the initial branch |