switch accounts, pull, push.

This commit is contained in:
Daveberry committed 2026-06-09 13:47:40 +08:00
1 parent 2b5c0dddc4
commit 3e87fa0d53
4 files changed
+53 -12

No files matched your search

+8 -4
View File
@@ -2,6 +2,8 @@ package cmd
import (
"fmt"
"os"
"os/exec"
"github.com/spf13/cobra"
)
@@ -15,10 +17,12 @@ var pushCmd = &cobra.Command{
Short: "Push changes to a destination",
Args: cobra.MaximumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
dest := "origin"
if len(args) > 0 {
dest = args[0]
}
dest := "main"
if len(args) > 0 { dest = args[0] }
fmt.Printf("Pushing changes to: %s...\n", dest)
out, err := exec.Command("git", "push", "origin", dest).CombinedOutput()
if err != nil { fmt.Fprintf(os.Stderr, "error: %s\n", err) }
fmt.Print(string(out))
},
}