Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)10k · #12001

speckit-git-initialize

Skill này làm gì

Skill này khởi tạo kho Git trong thư mục dự án và lưu bộ file đầu tiên. Skill dành cho người mới bắt đầu dự án và muốn có lịch sử phiên bản ngay từ đầu.

Khi nào nên dùng

  • ✓Khi bạn tạo một thư mục dự án mới và muốn theo dõi bằng Git ngay từ đầu.
  • ✓Khi thư mục dự án chưa được quản lý phiên bản.
  • ✓Khi bạn muốn commit đầu tiên với các file dự án được tạo tự động.

Liên kết skill

https://github.com/unoplatform/uno/blob/master/.claude/skills/speckit-git-initialize/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/unoplatform/uno/blob/master/.claude/skills/speckit-git-initialize/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Thiết lập Git cho thư mục dự án mới này và tạo commit đầu tiên với các file hiện có.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill kiểm tra xem Git đã được cài chưa và thư mục đã là kho Git chưa. Nếu chưa, skill khởi tạo kho, thêm các file và tạo commit đầu tiên.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Initialize Git Repository

Initialize a Git repository in the current project directory if one does not already exist.

Execution

Run the appropriate script from the project root:

  • Bash: .specify/extensions/git/scripts/bash/initialize-repo.sh
  • PowerShell: .specify/extensions/git/scripts/powershell/initialize-repo.ps1

If the extension scripts are not found, fall back to:

  • Bash: git init && git add . && git commit -m "Initial commit from Specify template"
  • PowerShell: git init; git add .; git commit -m "Initial commit from Specify template"

The script handles all checks internally:

  • Skips if Git is not available
  • Skips if already inside a Git repository
  • Runs git init, git add ., and git commit with an initial commit message

Customization

Replace the script to add project-specific Git initialization steps:

  • Custom .gitignore templates
  • Default branch naming (git config init.defaultBranch)
  • Git LFS setup
  • Git hooks installation
  • Commit signing configuration
  • Git Flow initialization

Output

On success:

  • ✓ Git repository initialized

Graceful Degradation

If Git is not installed:

  • Warn the user
  • Skip repository initialization
  • The project continues to function without Git (specs can still be created under specs/)

If Git is installed but git init, git add ., or git commit fails:

  • Surface the error to the user
  • Stop this command rather than continuing with a partially initialized repository
Câu hỏi thường gặp

Điều gì xảy ra nếu thư mục đã là kho Git?

Skill bỏ qua bước thiết lập, nên không thay đổi kho Git đã có.

Nếu chưa cài Git thì sao?

Skill sẽ cảnh báo và tiếp tục. Dự án vẫn hoạt động mà không cần Git.

Tôi có thể tùy chỉnh việc thiết lập không?

Có. Nội dung cho biết có thể thay script để thêm các bước như mẫu .gitignore hoặc thiết lập ký commit.

Chi tiết

Mô tả gốc của tác giả

Initialize a Git repository with an initial commit

repo: unoplatform/uno

Độ phổ biến

Sao GitHub
10k
Vị trí xếp hạng
#12001
Giấy phép
Apache-2.0
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự