git-pushing
它能做什么
这个工具可以帮你安全、有条理地把代码修改保存到远程仓库(比如 GitHub)。它会确保提交信息遵循统一格式,让人更容易看懂改了什么。
适用场景
- ✓想把工作成果保存到 GitHub 或 GitLab 时。
- ✓完成一段代码,准备分享时。
- ✓明确要求“推送”或“保存”修改时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/git-pushing/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我可以把修改推送到 GitHub 吗?”
每周 5 个新技能,1 分钟读完。
工作原理
这个工具会先确认你真的只推送了正确的文件,再为你所做的修改生成一条规范的提交信息,最后才把所有内容发送到远程仓库。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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/file
The 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.
常见问题
什么是“提交”(commit)?
它就像在某个时间点给代码拍下一张快照,并附上说明文字,记录改了什么。这样有助于追踪项目的历史。
什么是“推送”(push)?
推送是指把这些“提交”(即代码快照)从你的电脑发送到共享仓库(如 GitHub),以便他人查看,或作为备份保存。
为什么要使用统一格式的提交信息?
统一格式的信息(比如 feat: add login)能让人快速了解这次修改的类型和目的,便于协作和代码维护。
详情
作者的原始描述
Safely stage, commit, and push intended git changes with conventional commit messages. Use for ordinary non-release pushes when explicitly asked to push, save work remotely, or share a completed change.
热度
- GitHub 星标
- 48k
- 排名
- #4740
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。