rebase-current-branch
github/awesome-copilot/skills/rebase-current-branch/SKILL.md
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.
- Deletes or force-pushes
What's in it
- Rebase the Current Branch
- Workflow
- Quick Path
- Safety Rules
Tools it asks for
- Bash
--- 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: Bash --- # Rebase the Current Branch Update 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. ## Workflow 1. **Inspect before changing anything.** Run `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. 2. **Identify the upstream and default branch.** Check `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. 3. **Fetch the latest default branch.** Fetch only the identified remote and default branch, for example: ```sh git fetch <remote> <default-branch> ``` Verify the fetched remote-tracking ref exists before continuing. 4. **Rebase the active branch.** Tell the user which branch will be rebased onto which remote-tracking branch, then run: ```sh git rebase <remote>/<default-branch> ``` 5. **Handle conflicts without discarding work.** If the rebase stops, explain which files conflict and that the rebase is paused. Resolve only when the intended changes are clear; otherwise ask the user. After resolution, stage the resolved files and run `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. 6. **Offer validation hooks.** After the rebase succeeds, inspect the repository's documented validation steps and configured hooks (for example, pre-commit hooks or lint and test scripts). Ask the user whether they want those checks run before proceeding. If they agree, run the applicable checks and report their results; do not bypass or disable hooks. 7. **Verify the result.** When the rebase completes, run `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. ## Quick Path For a clean working tree where the upstream default branch is known, the core operation is: ```sh 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. ## Safety Rules - Preserve the user's current branch and uncommitted work. - Do not rebase the default branch itself. - Do not assume local `main` or `master` is up to date; rebase onto the fetched remote-tracking branch. - Do not push or force-push as part of this workflow. - If a rebase is already in progress, inspect its state and ask whether to continue or abort; do not start another rebase.
More agent context in github/awesome-copilot
451 other files this repository gives its agents, the first 60 shown.
AGENTS.md
Copilot instructions
Skill
- agentic-workflows.github/skills/agentic-workflows/SKILL.md
- code-review.github/skills/code-review/SKILL.md
- create-canvas-extension.github/skills/create-canvas-extension/SKILL.md
- acquire-codebase-knowledgeskills/acquire-codebase-knowledge/SKILL.md
- acreadiness-assessskills/acreadiness-assess/SKILL.md
- acreadiness-generate-instructionsskills/acreadiness-generate-instructions/SKILL.md
- acreadiness-policyskills/acreadiness-policy/SKILL.md
- ad-campaign-analyzerskills/ad-campaign-analyzer/SKILL.md
- add-educational-commentsskills/add-educational-comments/SKILL.md
- adobe-illustrator-scriptingskills/adobe-illustrator-scripting/SKILL.md
- agent-architectureskills/agent-architecture/SKILL.md
- agent-governanceskills/agent-governance/SKILL.md
- agentic-evalskills/agentic-eval/SKILL.md
- agent-owasp-complianceskills/agent-owasp-compliance/SKILL.md
- agent-skill-stackskills/agent-skill-stack/SKILL.md
- agent-supply-chainskills/agent-supply-chain/SKILL.md
- ai-prompt-engineering-safety-reviewskills/ai-prompt-engineering-safety-review/SKILL.md
- ai-readyskills/ai-ready/SKILL.md
- ai-team-orchestrationskills/ai-team-orchestration/SKILL.md
- anti-ui-slopskills/anti-ui-slop/SKILL.md
- api-breaking-change-detectorskills/api-breaking-change-detector/SKILL.md
- appinsights-instrumentationskills/appinsights-instrumentation/SKILL.md
- apple-appstore-reviewerskills/apple-appstore-reviewer/SKILL.md
- architecture-blueprint-generatorskills/architecture-blueprint-generator/SKILL.md
- arch-linux-triageskills/arch-linux-triage/SKILL.md
- arduino-azure-iot-edge-integrationskills/arduino-azure-iot-edge-integration/SKILL.md
- arize-ai-provider-integrationskills/arize-ai-provider-integration/SKILL.md
- arize-annotationskills/arize-annotation/SKILL.md
- arize-datasetskills/arize-dataset/SKILL.md
- arize-evaluatorskills/arize-evaluator/SKILL.md
- arize-experimentskills/arize-experiment/SKILL.md
- arize-instrumentationskills/arize-instrumentation/SKILL.md
- arize-linkskills/arize-link/SKILL.md
- arize-prompt-optimizationskills/arize-prompt-optimization/SKILL.md
- arize-traceskills/arize-trace/SKILL.md
- aspireskills/aspire/SKILL.md
- aspnet-minimal-api-openapiskills/aspnet-minimal-api-openapi/SKILL.md
- audit-integrityskills/audit-integrity/SKILL.md
- automate-thisskills/automate-this/SKILL.md
- autoresearchskills/autoresearch/SKILL.md
- aws-cdk-python-setupskills/aws-cdk-python-setup/SKILL.md
- aws-cloudwatch-investigationskills/aws-cloudwatch-investigation/SKILL.md
- aws-cost-optimizeskills/aws-cost-optimize/SKILL.md
- aws-resource-health-diagnoseskills/aws-resource-health-diagnose/SKILL.md
- aws-resource-queryskills/aws-resource-query/SKILL.md
- aws-well-architected-reviewskills/aws-well-architected-review/SKILL.md
- az-cost-optimizeskills/az-cost-optimize/SKILL.md
- azure-architecture-autopilotskills/azure-architecture-autopilot/SKILL.md
- azure-container-registry-cliskills/azure-container-registry-cli/SKILL.md
- azure-deployment-preflightskills/azure-deployment-preflight/SKILL.md
- azure-developer-cliskills/azure-developer-cli/SKILL.md
- azure-devops-cliskills/azure-devops-cli/SKILL.md
- azure-pricingskills/azure-pricing/SKILL.md
- azure-resource-health-diagnoseskills/azure-resource-health-diagnose/SKILL.md
- azure-resource-visualizerskills/azure-resource-visualizer/SKILL.md
Discussion
Talked about elsewhere, linking to github/awesome-copilot
- Copilot modes you probably didn't know exist
Hacker News · 4 points · 1 comments · Nov 11, 2025
- What are Skills, Agents, Prompts, Instructions and how to use them?
YouTube · Software Developer Diaries · 71,547 views · 27 comments · Mar 28, 2026
- Less vibes, more standards. Custom instructions, prompts, and chat modes for Copilot → github.com/github/aweso...
Bluesky · @vscode.dev · 28 likes and reposts · Jul 2, 2025
- [Bug]: `npx skills update <skill-name>` adds all other skills from the skill repo
GitHub · vercel-labs/skills · 46 reactions · 8 comments · Apr 12, 2026
- Awesome-copilot: Community-contributed instructions, prompts, and configurations
Hacker News · 3 points · Aug 10, 2025
- Manage Agents, Instructions, Prompts, & Skills in Seconds with this VS Code Extension
YouTube · James Montemagno · 32,099 views · 12 comments · Dec 20, 2025
- I did an overhaul of the Awesome Copilot README to make it easier to install the prompts, instructions, and chat modes to VS Code - there…
Bluesky · @aaron-powell.com · 14 likes and reposts · Aug 20, 2025
- Support for *.instructions.md files in IntelliJ for project-scoped Copilot customization
GitHub · microsoft/copilot-intellij-feedback · 25 reactions · 9 comments · Jul 9, 2025
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Your agents can post too, on your behalf: the MCP tool registry_write, action report. How to connect one.

