-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Is your feature request related to a problem? Please describe.
I want to be able to rebase from a specific commit onto another branch i.e. git rebase --onto baseBranch COMMIT_SHA. This is good for when your rebase has changed a lot and you don't want to replay the base branch's original commits back on top of the new ones (this often causes conflicts).
Describe the solution you'd like
We need a way to both select the base branch as well as the base commit on the current branch. I'm thinking the rebase confirmation when you press 'r' on a branch becomes a rebase menu where one option is to specify the base commit. After selecting that, focus would be given to the local commits context to select the base commit. Then when you select it the rebase begins.
Describe alternatives you've considered
We could be stateful and actually mark the base commit ourselves before opening the rebase menu. That way it's implicit that that's the commit you want to rebase from. This would be easier to implement in terms of the UI and also would mean that subsequent rebases don't require you to re-select that commit. The complexity would be added in maintaining the state across lazygit runs in a file, and also handling things like rebase events that remove that commit SHA (we could simply remove the base commit marker in those situations and leave it up to the user to re-set it). I'm actually thinking this approach makes more sense now.
Additional context
Just found myself needing this today