Created
March 4, 2026 09:30
-
-
Save cssence/b5070a735a52704472bc02d42371b8cd to your computer and use it in GitHub Desktop.
Rebase feature branch after latest commit on target branch has been modified
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # interactively rebase last <n> commits (defaults to 2): | |
| # pick needed ones and drop those that got modified on target branch | |
| git rebase -i HEAD~${1-"2"} | |
| # now reintegrate target branch (defaults to main) | |
| git rebase ${2-"main"} | |
| echo "Learn more at https://cssence.com/2026/rebase-feature-branch/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment