initialize_repo
Create a new Git repository at a specified path, optionally with an initial commit and README file. Works safely on existing repositories without modification.
Instructions
Initialize a new git repository at the specified path.
This tool creates a .git directory at repo_path if it doesn't already exist.
It is safe to call on an existing repository (it will return a success message without modifying the repo).
Args: repo_path: The absolute path to the directory where the git repository should be initialized. If the directory does not exist, it will be created. initial_commit: If True, and the repository is empty or fresh, an initial commit will be created. This includes creating a README.md if one doesn't exist. Default is True.
Returns: A status message indicating whether the repository was initialized, already existed, or if an initial commit was created.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | Yes | ||
| initial_commit | No |