git-pushing – skill Lập trình cho agent AI
Stage, commit và push các thay đổi git một cách an toàn với conventional commit message. Dùng cho các lần push thông thường không phải release khi được yêu cầu push, lưu công việc lên remote hoặc chia sẻ thay đổi đã hoàn thành.
Cài skill git-pushing bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/git-pushing-c6175.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /git-pushing – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/git-pushing-c6175.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $git-pushing – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/git-pushing-c6175.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /git-pushing – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/git-pushing-c6175.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /git-pushing – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Git Push Workflow
Stage only intended changes, create a conventional commit, and push to the remote branch.
When to Use
Automatically activate when the user:
- Explicitly asks to push changes ("push this", "commit and push")
- Mentions saving work to remote ("save to github", "push to remote")
- Completes a feature and wants to share it
- Says phrases like "let's push this up" or "commit these changes"
Safety Gates
Before staging, inspect git status --short --branch, confirm the intended files, and fetch the upstream branch when a concurrent push is plausible. Do not absorb unrelated dirty files.
Read repository policy before choosing the destination branch. If main or master is protected, or the repository defines a maintainer command such as merge:batch, create or use a topic branch and finish through the required pull-request checks. A user request to “push to main” describes the desired final state; it does not authorize bypassing server-side protection. Never keep retrying a direct push after a protected-branch rejection.
The helper requires an empty live index and a conventional commit message before it stages anything. It locks the live index, builds and validates the commit in an isolated temporary index, rejects -- without paths, and atomically updates the branch only if its parent is unchanged.
The helper honors branch.<name>.pushRemote, remote.pushDefault, and the branch's configured upstream, in that order. For a new branch without those settings, it requires origin and establishes origin/<branch>. It rejects detached HEAD and invalid remote configurations before staging.
Do not use this skill for a maintainer merge batch, canonical synchronization, versioned repository release, tag publication, or a repository with an explicit merge:batch, release:prepare, or release:publish workflow. Use that repository's maintainer/release flow instead; it owns pull-request evidence, protected-branch checks, generated files, tags, and publication verification.
Workflow
Use the helper only after the safety gates pass. Resolve the installed directory that contains this SKILL.md and substitute its absolute path for <skill-directory> below; do not assume the current working directory is the catalog repository. With no paths the helper stages all current changes, so use that form only when every dirty file belongs to the requested commit:
bash "<skill-directory>/scripts/smart_commit.sh"With custom message:
bash "<skill-directory>/scripts/smart_commit.sh" "feat: add feature"To stage only named files, pass them after --:
bash "<skill-directory>/scripts/smart_commit.sh" "fix: scope change" -- path/to/fileThe helper handles isolated staging, commit creation, and push; it does not replace validation, release tooling, or a rebase required by an advanced upstream branch.
Limitations
- The helper currently requires Git's
filesref backend; it rejectsreftablerepositories before creating a commit because their refs cannot use the filesystem lock protocol. - Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Skill liên quan
- git-workflow – Triển khai các chiến lược phân nhánh Git, quy trình PR và mẫu quản lý release.
- git-workflow-and-versioning – Cấu trúc hóa thực hành quy trình git. Dùng khi thực hiện bất kỳ thay đổi code nào. Dùng…
- github – Dùng CLI `gh` cho issue, pull request, lần chạy Actions và truy vấn GitHub API.
- github-actions – Xây dựng, kiểm thử và triển khai ứng dụng bằng quy trình GitHub Actions.
- github-actions-advanced – Thiết kế, gỡ lỗi và củng cố quy trình CI/CD GitHub Actions, bao gồm reusable workflows…
- github-actions-debugger – Kỹ năng chuyên biệt để chẩn đoán, phân tích và sửa các quy trình GitHub Actions bị lỗi…
- github-actions-templates – Các mẫu quy trình GitHub Actions sẵn sàng cho production để kiểm thử, build và triển…
- github-automation – Thao tác với issues, pull requests, branches, checks, workflows và quyền trên GitHub qua…