1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Add new command "Move commits to new branch"

This commit is contained in:
Stefan Haller
2024-08-30 12:27:50 +02:00
parent 4bf11eae4b
commit 30868eead8
11 changed files with 423 additions and 4 deletions

View File

@ -80,6 +80,17 @@ func (self *BasicCommitsController) GetKeybindings(opts types.KeybindingsOpts) [
GetDisabledReason: self.require(self.singleItemSelected()),
Description: self.c.Tr.CreateNewBranchFromCommit,
},
{
// Putting this in BasicCommitsController even though we really only want it in the commits
// panel. But I find it important that this ends up next to "New Branch", and I couldn't
// find another way to achieve this. It's not such a big deal to have it in subcommits and
// reflog too, I'd say.
Key: opts.GetKey(opts.Config.Branches.MoveCommitsToNewBranch),
Handler: self.c.Helpers().Refs.MoveCommitsToNewBranch,
GetDisabledReason: self.c.Helpers().Refs.CanMoveCommitsToNewBranch,
Description: self.c.Tr.MoveCommitsToNewBranch,
Tooltip: self.c.Tr.MoveCommitsToNewBranchTooltip,
},
{
Key: opts.GetKey(opts.Config.Commits.ViewResetOptions),
Handler: self.withItem(self.createResetMenu),