Tech Notes

Rebase

Batch Rename Commit Messages with VS Code

Contents


Quick Setup

git config --global core.editor "code --wait"

This lets Git use VS Code for rebase editing instead of vim.

Contents

The Process

  1. Start rebase from first commit
    git rebase -i --root
    
  2. Mark commits to change
    In VS Code: change pickreword on target commits. Save & close tab.

  3. Edit each message
    VS Code opens for each commit. Edit message (e.g., postnote). Save & close.

  4. Push rewritten history
    git push origin main --force
    

Contents

Commands

# Set editor
git config --global core.editor "code --wait"

# Interactive rebase from root
git rebase -i --root

# Force push after rebase
git push origin main --force

Key Points

Contents