Zum Inhalt springen
Skillpedia
Deployment & Cloud (DevOps)40k · #7393

rebase-current-branch

Was er macht

Dieses Tool aktualisiert deinen 'Branch' (eine eigene Arbeitslinie) mit den neuesten Änderungen aus dem Hauptbranch des Projekts. Dabei geht es sicher vor, damit deine Arbeit nicht verloren geht.

Wann du ihn nutzt

  • ✓Wenn du die neuesten Änderungen aus dem Hauptbranch in deine Arbeit übernehmen möchtest.
  • ✓Bevor du jemanden bittest, deinen Code zu prüfen.
  • ✓Wenn du deine Arbeit mit der des Teams zusammenführen möchtest.

Link zum Skill

https://github.com/github/awesome-copilot/blob/main/skills/rebase-current-branch/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/github/awesome-copilot/blob/main/skills/rebase-current-branch/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Aktualisiere meine Arbeit mit den neuesten Änderungen aus dem Hauptbranch.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Das Tool prüft zuerst, ob es nicht gespeicherte Arbeit gibt, und fragt dich, was damit passieren soll. Dann holt es den neuesten Stand des Hauptbranchs und setzt deine Änderungen obendrauf, sodass alles übersichtlich bleibt.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

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:

    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:

    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:

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.
Häufige Fragen

Was ist ein 'Branch'?

Stell dir einen Branch als Kopie des Projekts vor, in der du arbeiten kannst, ohne die Hauptversion zu beeinflussen. Es ist wie ein Entwurf, in dem du Änderungen machen kannst.

Was bedeutet 'Rebase'?

'Rebase' ist wie das Umsortieren deiner Arbeit. Statt sie nur zusammenzuführen, nimmt das Tool deine Änderungen und setzt sie 'obendrauf' auf die neuesten Updates, so als hättest du deine Arbeit erst danach begonnen.

Was passiert bei Konflikten?

Wenn deine Arbeit und die Updates im Hauptbranch denselben Teil des Codes verändert haben, entsteht ein Konflikt. Das Tool benachrichtigt dich und bittet dich, zu entscheiden, welche Version behalten werden soll.

Details

Originalbeschreibung des Autors

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.

repo: github/awesome-copilot

Beliebtheit

GitHub-Sterne
40k
Platz im Ranking
#7393
Lizenz
MIT
Aktualisiert
15.10.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills