Git提交和推送

A command that saves local Git changes, incorporates updates from a remote repository, and sends the result back to configured remotes. Git is a system for tracking changes to code, while a remote repository is a shared online copy.

In plain words
What is it for?
Use it when your code is ready to save and share, especially when working with branches and multiple remote repositories.
Why use it?
It gives a repeatable way to check, commit, update, and publish work. It also reports failures from individual remotes without stopping every push.

Command for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/nongjun/feishu-cursor-claw/git
Clone the repo
git clone --depth 1 https://github.com/nongjun/feishu-cursor-claw

Made for: Cursor.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 669 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00669
Opus 5 $0.00000 $0.00334
Sonnet 5 $0.00000 $0.00134
Haiku 4.5 $0.00000 $0.00067

Measured 2d ago against content hash 6e69e2ffcf9c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

Git提交和推送 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/commands/Git提交和推送.md · 84 lines

What it actually says

Git 提交和推送命令

当用户调用此命令时,执行以下操作:

目标仓库

  • 默认仓库:当前工作区根目录
  • 自动检测已配置的远程仓库(origin 及其他远程)
  • 所有 git 操作通过本命令执行

操作步骤

设计原则:先提交再拉取,本地更改始终安全保存在提交中

0. 健康检查(自动执行,有问题才输出)

检查并自动修复常见的 Git 仓库问题:

  • 如果存在 stash,清理掉(本项目禁止使用 stash)
  • 如果 index 文件损坏(存在未解决的合并冲突标记),重建 index

1. 检查 Git 状态

  • 运行 git status 查看当前工作区
  • 如果没有任何更改,提示用户并结束

2. 提交代码

  • git add -A
  • 分析改动内容,生成提交信息:
    • 格式:[类型] 简要描述
    • 类型:feat / fix / docs / style / refactor / chore
    • 多模块改动时:第一行概括,下方按模块列出要点
  • git commit -m "提交信息"

3. 拉取远程更新

  • git pull --rebase origin <当前分支>
  • rebase 保持线性历史,不同文件会自动合并

4. 推送到远程

  • 自动检测所有已配置的远程仓库,并行推送
  • 对非主远程设置 45 秒超时(网络不稳定时),超时不阻塞,提示后续手动重试即可
  • 新分支使用 git push -u

5. 输出结果表格

| 步骤 | 状态 |
|------|------|
| 健康检查 | ✅ / ⚠️ 已修复 |
| 提交 | ✅ commit_hash — 文件数, +增/-删 |
| 拉取更新 | ✅ / 合并了 N 个提交 |
| 推送 origin | ✅ / ❌ |
| 推送 其他远程 | ✅ / ⏳ 超时 |

示例提交信息

单模块:

[feat] 添加用户登录功能

多模块:

[feat] 用户管理优化与消息模块增强

用户管理:
- 新增批量导入功能
- 权限校验优化

消息模块:
- 新增模板消息支持

注意事项

  • 显示操作的每一步结果,让用户了解进度
  • 某个远程推送失败不影响其他远程的推送
  • 禁止使用 git stash:本项目采用"先提交再拉取"策略
  • 冲突标记搜索排除 node_modules 和 .git 目录
  • 如果 Cursor 的 git 扩展已禁用(git.enabled: false),请勿恢复,避免自动 stash 污染 index
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 84 lines · 0 tokens per session scan A 6e69e2ffcf9c

Subscribe to this mod's changes

Git提交和推送 is a command published in the GitHub repository nongjun/feishu-cursor-claw (14 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 669 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.