安装方式
命令行安装
在项目根目录执行以下命令,完成 Skill 安装。
npx bzskills add github/awesome-copilot --skill rebase-current-branch Rebase the currently checked out feature branch onto the latest upstream default branch. Use when asked to update a branch with main or master, rebase the current branch onto the default branch, or sync a feature branch before review. Detects whether the repository uses main or master and guides safe conflict handling.
0
下载量
命令行安装
在项目根目录执行以下命令,完成 Skill 安装。
npx bzskills add github/awesome-copilot --skill rebase-current-branch name: rebase-current-branch
description: Rebase the currently checked out feature branch onto the latest upstream default branch. Use when asked to update a branch with main or master, rebase the current branch onto the default branch, or sync a feature branch before review. Detects whether the repository uses main or master and guides safe conflict handling.
license: MIT
allowed-tools: BashUpdate the active branch by replaying its commits on top of the latest default branch from its upstream remote. Use the repository's actual default branch, whether it is named main, master, or another branch.
git status --porcelain=v1 --branch --untracked-files=all and git branch --show-current. Confirm the current branch is not the default branch and note any local changes. If the working tree has changes, stop and ask the user whether to commit, stash, or otherwise handle them. Do not stash automatically.git remote -v and git remote show <remote> (or the remote's symbolic HEAD) to determine the branch this repository treats as its default. Prefer the configured upstream for the current branch when available; otherwise use origin. Do not assume that main exists or that a branch named master is current. If the default branch cannot be identified unambiguously, ask the user. git fetch <remote> <default-branch>
Verify the fetched remote-tracking ref exists before continuing.
git rebase <remote>/<default-branch>
git rebase --continue. If the user wants to abandon the operation, run git rebase --abort. Never use git reset --hard, discard user changes, or skip commits to force completion.git status --porcelain=v1 --branch --untracked-files=all and summarize the outcome, including the base branch used, validation results if run, and any remaining changes. Do not push, force-push, or amend commits unless the user separately asks.For a clean working tree where the upstream default branch is known, the core operation is:
git fetch <remote> <default-branch>
git rebase <remote>/<default-branch>
Replace <default-branch> with the detected branch name (main, master, or another configured default). Never run the placeholder commands literally.
main or master is up to date; rebase onto the fetched remote-tracking branch.