git-sync-main
Installation
SKILL.md
Git Sync Main
同步最新主分支代码到本地并切换到主分支。支持两种场景:fork 的项目从 official remote 同步,自己的项目从 origin 同步。
触发条件
当用户要求同步上游代码、更新主分支、或拉取最新主分支代码时使用此 skill。
执行步骤
-
检查 remote 配置:
git remote -v,确认是否存在officialremote。 -
根据是否存在 official remote 分两种情况执行:
情况一:存在 official remote(fork 的项目)
-
检测主分支名称:通过
git remote show official或查看本地分支,确定主分支名称(main或master)。 -
拉取 official 最新代码:
git fetch official。
Related skills
More from zc277584121/mygitplugin
git-summarize-weekly
Summarize weekly GitHub contributions for writing weekly reports
152git-create-repo
Create a new GitHub repository and clone it locally
150git-commit-push
Commit changes and push to origin without creating a PR
150git-fork-clone
Fork a GitHub repo and clone it locally with proper remote setup
149git-commit-pr
Commit changes and create a pull request to the official upstream repo
149git-get-notification
Check GitHub notifications and recent Issues/PRs for monitored repos
148