Skip to main content
  1. Learn center
  2. Software Development
  3. Guides
  4. Git tutorial
  5. Git 的基礎知識
  6. 管理 Git 歷史紀錄
  7. 將提交複製到新分支
GuidesSoftware DevelopmentBacklog
Git

Project and code management together.

將提交複製到新分支

變基是將在一個分支上提交的所有更改複製到新分支的過程。

執行 git rebase 指令並加上-i選項以重寫、替換、刪除和合併歷史紀錄中的個別提交。

您也可以使用變基指令來:

  • 重寫過去的提交訊息
  • 將一組提交壓縮在一起
  • 新增尚未提交的檔案
Diagram of reabsing.
Diagram of identifying a commit to rewrite.
確定要重寫的提交並執行 git rebase -i 指令。

Subscribe to our newsletter

Learn with Nulab to bring your best ideas to life