Skip to content

Commit 19ae093

Browse files
author
Tobias Meinhardt
committed
Stash changes before checkout branch in push cmd
1 parent 060e64c commit 19ae093

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/cli/cmd/push.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,15 @@ var pushCmd = &cobra.Command{
4040
currentBranch = cb
4141
}
4242

43+
err = g.Stash()
44+
util.CheckForError(err, "Stash")
45+
4346
err = g.Checkout(currentBranch)
4447
util.CheckForError(err, "Checkout")
4548

49+
err = g.StashPop()
50+
util.CheckForError(err, "StashPop")
51+
4652
if pushCmdOptions.AddAll {
4753
err = g.AddAll()
4854
util.CheckForError(err, "AddAll")

0 commit comments

Comments
 (0)