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

use selected branch as base when creating a new branch

This commit is contained in:
Jesse Duffield
2020-03-08 13:19:38 +11:00
parent e541b809ce
commit 19146d61b1
3 changed files with 9 additions and 6 deletions

View File

@ -327,8 +327,8 @@ func (c *GitCommand) ResetToCommit(sha string, strength string) error {
}
// NewBranch create new branch
func (c *GitCommand) NewBranch(name string) error {
return c.OSCommand.RunCommand("git checkout -b %s", name)
func (c *GitCommand) NewBranch(name string, baseBranch string) error {
return c.OSCommand.RunCommand("git checkout -b %s %s", name, baseBranch)
}
// CurrentBranchName is a function.