How this skill is triggered — by the user, by Claude, or both
Slash command
/git-tools:remoteThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
远程仓库管理技能 - 智能推送、拉取和多仓库同步。
远程仓库管理技能 - 智能推送、拉取和多仓库同步。
# 安全推送
/remote push main --safe
# 智能拉取
/remote pull --auto
# 同步所有分支
/remote sync --all
# 多仓库推送
/remote push-all --remotes origin,backup
git push| 选项 | 说明 | 使用场景 |
|---|---|---|
--safe | 安全部全检查后推送 | 默认推荐 |
--force-with-lease | 安全强制推送 | 确认需要覆盖时 |
--no-verify | 跳过钩子(谨慎) | 紧急修复 |
--tags | 同时推送标签 | 版本发布 |
# ❌ 危险:可能覆盖他人提交
git push --force
# ✅ 安全:仅在远程无更新时强制
git push --force-with-lease
| 命令 | 说明 | 适用场景 |
|---|---|---|
git pull | 拉取并合并 | 快速同步 |
git pull --rebase | 拉取并变基 | 保持线性历史 |
git fetch | 仅拉取不合并 | 先查看再决定 |
git fetch origin# 优先使用 rebase 保持历史整洁
git pull --rebase origin main
# 如果有冲突,解决后继续
git add <resolved-files>
git rebase --continue
# 放弃 rebase
git rebase --abort
# 添加备用远程
git remote add backup https://github.com/org/backup.git
# 查看所有远程
git remote -v
# 推送到所有远程
git push --all origin backup
# 同步特定分支
git push origin main && git push backup main
# 使用 sync 命令一键同步
/remote sync --all --remotes origin,backup,upstream
# 查看远程分支
git branch -r
# 查看本地与远程差异
git log HEAD..origin/main --oneline
# 查看远程提交
git log origin/main --oneline -5
{
"remote": {
"safetyChecks": true,
"autoSync": false,
"multiRemote": true,
"defaultPushStrategy": "safe",
"remotes": {
"origin": "https://github.com/org/repo.git",
"backup": "https://github.com/org/backup.git"
}
}
}
--force-with-lease 替代 --force--force 强制推送npx claudepluginhub protagonistss/ithinku-plugins --plugin git-toolsPushes local Git commits to remote repositories, handling branch tracking, upstream setup, safe push patterns like force-with-lease, and verification. Useful after local commits when syncing to remote.
Provides git command patterns, branching strategy, and safety protocols for managing branches, resolving merge conflicts, and running commit/merge/push operations.