About git-sync
A Git synchronization skill for bringing local and remote repositories into alignment by pushing changes. It requires a clean working tree, prefers rebase, and directs users to understand both sides before resolving conflicts.
Key features
- 01Checks for a clean working tree
- 02Prefers rebase for synchronization
- 03Preserves existing commits
- 04Resolves conflicts by intent
Use cases
- 01Preparing a repository before syncing
- 02Updating a local branch from remote
- 03Resolving conflicts while preserving changes
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ gitbobobo/ skills --skill git-syncAfter installing, type/git-syncin Claude Code to confirm it loaded.
Details
From the project README同步 git 远程并解决冲突,使本地和远程保持一致(推送到远程)。
同步要求
- 同步前确保工作区干净:先检查
git status --porcelain,若有未提交变更先完成提交(按 git-commit 工作流),再同步,避免 rebase / merge 时产生冲突或丢失改动 - 优先通过 rebase 保持线性历史
- 禁止直接丢弃提交内容,必须根据提交时间理解修改意图
- 冲突需先理解双方修改意图再解决,必要时征求用户意见
Comments
Markdown supported