mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-23 00:39:13 +02:00
popup force push confirmation panel if the local branch has diverged from the upstream branch
This commit is contained in:
@ -270,8 +270,12 @@ func (c *GitCommand) Pull() error {
|
||||
}
|
||||
|
||||
// Push push to a branch
|
||||
func (c *GitCommand) Push(branchName string) error {
|
||||
return c.OSCommand.RunCommand("git push -u origin " + branchName)
|
||||
func (c *GitCommand) Push(branchName string, force bool) error {
|
||||
forceFlag := ""
|
||||
if force {
|
||||
forceFlag = "--force-with-lease "
|
||||
}
|
||||
return c.OSCommand.RunCommand("git push " + forceFlag + "-u origin " + branchName)
|
||||
}
|
||||
|
||||
// SquashPreviousTwoCommits squashes a commit down to the one below it
|
||||
|
Reference in New Issue
Block a user