본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)40k · #7393

rebase-current-branch

하는 일

이 도구는 '브랜치'(별도의 작업 줄기)를 프로젝트 주 브랜치의 최신 변경 사항을 포함하도록 업데이트합니다. 여러분의 작업이 사라지지 않도록 안전하게 진행합니다.

사용하는 경우

  • ✓주 브랜치의 최신 변경 사항을 내 작업에 반영하고 싶을 때.
  • ✓코드 리뷰를 요청하기 전에.
  • ✓내 작업을 팀의 작업과 병합하고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/github/awesome-copilot/blob/main/skills/rebase-current-branch/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“주 브랜치의 최신 변경 사항을 내 작업에 반영해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 먼저 저장하지 않은 작업이 있는지 확인하고, 어떻게 할지 묻습니다. 그다음 주 브랜치의 최신 내용을 가져와 여러분의 작업 위에 적용하고, 모든 것을 정돈된 상태로 유지합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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.
자주 묻는 질문

'브랜치'는 무엇인가요?

주 버전에 영향을 주지 않고 작업할 수 있는 프로젝트의 사본이라고 생각하면 됩니다. 변경을 시험해 볼 수 있는 초안과 같습니다.

'리베이스(rebase)'는 무엇을 뜻하나요?

작업의 순서를 다시 배열하는 것과 같습니다. 단순히 합치는 것이 아니라, 여러분의 변경을 최신 업데이트 위에 올려놓아, 그 업데이트 이후에 작업을 시작한 것처럼 만듭니다.

충돌이 생기면 어떻게 하나요?

여러분의 작업과 주 브랜치의 업데이트가 같은 코드 부분을 바꾸면 충돌이 생깁니다. 도구는 이를 알려 주고, 어느 버전을 유지할지 결정하도록 도움을 요청합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
40k
순위
#7393
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬