# Git Initialization

> Use when users ask to initialize git, set up repository version control, create first commit setup, or verify repository initialization state. Detects existing repositories, initializes safely when needed, and supports optional initial configuration.

- Skill: `ashish102/git-initialization` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add ashish102/git-initialization`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ashish102/git-initialization/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: ashish102 (https://skillmd.com/u/ashish102)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/ashish102/git-initialization

---


# Git Initialization Instructions
When the user asks to initialize a Git repository, follow these steps:
1. Check if a Git repository already exists in the current directory using `git status` or by checking for a `.git` folder.
2. If a repository exists, inform the user and ask if they want to reinitialize.
3. If no repository exists, run `git init` to initialize a new repository.
4. Optionally set up initial configuration (user.name, user.email) if provided by the user.
5. Optionally create an initial commit if requested.

Additional references:
- Overview: see OVERVIEW.md
- Usage details: see USAGE.md
- Examples: see EXAMPLES.md

