1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-04 03:48:07 +02:00

Added rebase functions

This commit is contained in:
Glenn Vriesman 2018-11-29 17:57:28 +01:00 committed by Jesse Duffield
parent 822dc5dada
commit 670f0e37c7

View File

@ -260,6 +260,19 @@ func (c *GitCommand) RenameCommit(name string) error {
return c.OSCommand.RunCommand(fmt.Sprintf("git commit --allow-empty --amend -m %s", c.OSCommand.Quote(name)))
}
func (c *GitCommand) RebaseBranch(onto string) error {
curBranch, err := c.CurrentBranchName()
if err != nil {
return err
}
return c.OSCommand.RunCommand(fmt.Sprintf("git rebase %s %s ", onto, curBranch))
}
func (c *GitCommand) AbortRebaseBranch() error {
return c.OSCommand.RunCommand("git rebase --abort")
}
// Fetch fetch git repo
func (c *GitCommand) Fetch() error {
return c.OSCommand.RunCommand("git fetch")