git-init
Quickly setup a new git repository with project-specific best practices.
Install
mkdir -p .claude/skills/git-init && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13486" && unzip -o skill.zip -d .claude/skills/git-init && rm skill.zipInstalls to .claude/skills/git-init
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Initialize a new git repository with standard structure: .gitignore, README, initial commit, and optional remote setup. Use when: init git, new repo, setup git project, create repository.Key capabilities
- →Check for existing git repository
- →Detect project type
- →Create `.gitignore` based on project type
- →Create `README.md`
- →Perform initial git commit
How it works
The skill checks for an existing git repo, detects the project type to create a `.gitignore`, creates a `README.md`, and then initializes git with an initial commit.
Inputs & outputs
When to use git-init
- →Initialize new Python project
- →Setup git repo
- →Create initial commit
About this skill
Step 1 — Check Environment
Run git status to check if a git repo already exists.
- If already initialized, report "Git repo already exists" and stop.
Detect project type by scanning for common config files:
package.json→ Node.jsrequirements.txt/pyproject.toml→ Pythongo.mod→ GoCargo.toml→ Rustpom.xml/build.gradle→ Java- None detected → generic
Step 2 — Create .gitignore
If .gitignore does not exist, create one based on the detected project type.
Node.js:
node_modules/
dist/
.env
.env.local
*.log
.DS_Store
Python:
__pycache__/
*.py[cod]
*.egg-info/
dist/
build/
.env
.venv/
venv/
.DS_Store
Go:
bin/
*.exe
*.test
.env
.DS_Store
Rust:
target/
.env
.DS_Store
Java:
target/
*.class
*.jar
.mvn/
.env
.DS_Store
Generic:
.env
.DS_Store
*.log
tmp/
Step 3 — Create README (if missing)
If README.md does not exist, create a minimal one:
# <project folder name>
> TODO: Add project description.
Step 4 — Initialize & Initial Commit
Run:
git initgit add -Agit commit -m "chore: initial commit"
Report the commit hash.
Step 5 — Set Up Remote (optional)
Ask the user (or infer from their argument) which situation applies:
场景 A — 用户已有远程仓库 URL
设置代理并关联推送:
export http_proxy="http://127.0.0.1:10080" https_proxy="http://127.0.0.1:10080"
git remote add origin <url>
git branch -M main
git push -u origin main
场景 B — 需要在 GitHub 上新建仓库(使用 gh CLI)
检查 gh 是否可用:which gh
若可用,运行:
gh repo create <repo-name> --public --source=. --remote=origin --push
- 默认使用当前文件夹名作为
<repo-name> - 可按需改为
--private --source=. --remote=origin --push会自动关联并推送
若 gh 不可用,提示用户安装:
brew install gh # macOS
gh auth login
场景 C — 需要在 GitHub 上新建仓库(使用 MCP GitHub 工具)
若环境中有 mcp_github_create_repository 工具可用:
- 调用该工具创建仓库,获取返回的
clone_url - 然后关联并推送:
git remote add origin <clone_url>
git branch -M main
export http_proxy="http://127.0.0.1:10080" https_proxy="http://127.0.0.1:10080"
git push -u origin main
``` — 不需要远程仓库
跳过此步骤,仅提示用户后续可用以下命令手动添加:
git remote add origin <url> git push -u origin main
When not to use it
- →When a git repository already exists and is initialized
- →When the user does not want a standard `.gitignore` or `README.md`
Prerequisites
Limitations
- →Reports 'Git repo already exists' and stops if a repo is found
- →Creates a minimal `README.md` if one does not exist
How it compares
This skill automates the setup of a git repository with common files, unlike manually creating each file and running git commands.
Compared to similar skills
git-init side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| git-init (this skill) | 0 | 1mo | Review | Beginner |
| resolve-conflicts | 81 | 8mo | Review | Intermediate |
| openspec-onboard | 10 | 6mo | Review | Beginner |
| codex-cli-bridge | 9 | 9mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
resolve-conflicts
antinomyhq
Use this skill immediately when the user mentions merge conflicts that need to be resolved. Do not attempt to resolve conflicts directly - invoke this skill first. This skill specializes in providing a structured framework for merging imports, tests, lock files (regeneration), configuration files, and handling deleted-but-modified files with backup and analysis.
openspec-onboard
studyzy
Guided onboarding for OpenSpec - walk through a complete workflow cycle with narration and real codebase work.
codex-cli-bridge
alirezarezvani
Bridge between Claude Code and OpenAI Codex CLI - generates AGENTS.md from CLAUDE.md, provides Codex CLI execution helpers, and enables seamless interoperability between both tools
skill-sync
KyleKing
Syncs Claude Skills with other AI coding tools like Cursor, Copilot, and Codeium by creating cross-references and shared knowledge bases. Invoke when user wants to leverage skills across multiple tools or create unified AI context.
github-workflow-automation
ruvnet
Advanced GitHub Actions workflow automation with AI swarm coordination, intelligent CI/CD pipelines, and comprehensive repository management
git-advanced-workflows
wshobson
Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.