How to rebase without intermediate commit on git?

by ryan.murray , in category: Third Party Scripts , 3 months ago

How to rebase without intermediate commit on git?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by elise_daugherty , 3 months ago

@ryan.murray 

To rebase without intermediate commit on Git, you can use the following command:

1
git rebase -i HEAD~n


Replace n with the number of commits you want to rebase. This command will open an interactive rebase editor where you can choose which commits to pick, edit, squash, or drop. You can reorder the commits as necessary without creating any intermediate commits.


After completing the interactive rebase, you can continue with the rebase process using the following command:

1
git rebase --continue


This will apply the changes from the selected commits onto the base branch without creating any intermediate commits.