1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

support setting upstream

This commit is contained in:
Jesse Duffield
2019-11-17 14:50:12 +11:00
parent b42202ea1c
commit 07cbae4019
6 changed files with 55 additions and 5 deletions

View File

@ -1087,3 +1087,7 @@ func (c *GitCommand) IsHeadDetached() bool {
func (c *GitCommand) DeleteRemoteBranch(remoteName string, branchName string) error {
return c.OSCommand.RunCommand(fmt.Sprintf("git push %s --delete %s", remoteName, branchName))
}
func (c *GitCommand) SetBranchUpstream(remoteName string, remoteBranchName string, branchName string) error {
return c.OSCommand.RunCommand(fmt.Sprintf("git branch --set-upstream-to=%s/%s %s", remoteName, remoteBranchName, branchName))
}