360 Secure SkillHub
360 安全技能中心

Git Sync

通过 python3 scripts/git_ctrl.py 提供 git 仓库管理:查看状态、日志、diff、分支、fetch,以及需 --confirm 的 pull/push。仅允许白名单仓库,禁止 clean、reset --hard、push --force,不暴露凭据。仓库列表可通过配置文件覆盖默认值。

lookupmark
lookupmark
热度 44.58
最近更新 2026-05-11 17:40:12
分类:开发依赖:代码执行 / 读写文件应用场景:自动化脚本 / 工作流 / DevOps

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add lookupmark-git-sync
Metadata
name
git-sync
dependencies
["git CLI (https://git-scm.com)"]
description
Manage whitelisted git repositories from chat. Status, log, diff, pull, push with security controls — only approved repos, write commands need confirmation. Repo list configurable via ~/.config/git-sync/repos.json (overrides defaults). Triggers on "git status", "repo status", "push thesis", "pull polito", "check repo", "uncommitted changes", "commit recenti". NOT for: arbitrary git repos, destructive operations (clean, reset --hard).

Git Sync

Secure git repository management for whitelisted repos.

Usage

# Status of all repos
python3 scripts/git_ctrl.py all

# Status of specific repo
python3 scripts/git_ctrl.py status thesis
python3 scripts/git_ctrl.py status polito

# Recent commits
python3 scripts/git_ctrl.py log thesis -n 20

# Unstaged changes
python3 scripts/git_ctrl.py diff thesis

# Branches
python3 scripts/git_ctrl.py branch thesis

# Fetch (read-only, safe)
python3 scripts/git_ctrl.py fetch thesis

# Pull (requires confirmation)
python3 scripts/git_ctrl.py pull thesis --confirm

# Push (requires confirmation)
python3 scripts/git_ctrl.py push thesis --confirm

Allowed Repos

Name Path
thesis ~/Documenti/github/thesis
polito ~/Documenti/github/polito

Security

  • Whitelist: Only thesis and polito repos are accessible
  • Read-only by default: status, log, diff, branch, fetch run freely
  • Write requires --confirm: pull, push, merge, checkout need explicit confirmation
  • Blocked commands: clean, reset --hard, push --force are never allowed
  • No secrets: Output does not expose git credentials or tokens