I have a branch with a few commits I'd like to interactively rebase. However, after pulling and merging there are now other commits interleaved with mine so I can't just do something like git rebase -i HEAD~3
Is it possible to do an interactive rebase while choosing individual commits? Something like git rebase -i 23duirs 3eujsfe ...
Another possibility-- If I simply run git rebase -i
I believe it's possible to cut and paste my commit lines to be consecutive, and squash from there, is that correct? Is there a best practice for doing so, to minimize the chance of conflicts with the unrelated commits in there?
Given this
pick <unrelated a>
pick A
pick <unrelated b>
pick B
pick <unrelated c>
you can definitely do
pick <unrelated a>
pick <unrelated b>
pick <unrelated c>
pick A
squash B
Provided that your commit are really unrelated to the other changes, this will work just fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With