rebase2main

将当前开发分支的提交以 rebase 方式同步到 main 分支,推送远端,再切回原分支。

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "rebase2main" with this command: npx skills add ruan-cat/monorepo/ruan-cat-monorepo-rebase2main

Rebase to Main

将当前开发分支的提交以 rebase 方式同步到 main 分支,推送远端,再切回原分支。

工作流程

记录当前分支名称

git branch --show-current

将结果保存,后续用于切回。如果当前已在 main 分支,提示用户并终止。

确认工作树干净

git status

如果存在未提交的变更,提示用户先处理(提交或暂存),不要继续。

切换到 main 分支

git checkout main

将 dev 的提交 rebase 到 main

git rebase <原分支名>

如果出现冲突,停止并告知用户需要手动解决。

推送 main 到远端

git push origin main

使用普通 push,不使用 --force 。如果 push 失败,告知用户原因。

切回原分支

git checkout <原分支名>

注意事项

  • 不使用 --force 推送,保证远端历史安全

  • 如果 rebase 过程中出现冲突,立即停止并告知用户

  • 执行前必须确认工作树干净(无未提交变更)

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

git-commit

No summary provided by upstream source.

Repository SourceNeeds Review
General

openspec

No summary provided by upstream source.

Repository SourceNeeds Review
General

openspec-explore

No summary provided by upstream source.

Repository SourceNeeds Review